summaryrefslogtreecommitdiff
path: root/src/bus-proxyd/bus-policy.c
diff options
context:
space:
mode:
authorMichal Schmidt <mschmidt@redhat.com>2014-11-28 11:58:34 +0100
committerMichal Schmidt <mschmidt@redhat.com>2014-11-28 12:04:41 +0100
commit0a1beeb64207eaa88ab9236787b1cbc2f704ae14 (patch)
tree50117277be2e2078d0373b944a30b4f09bb94443 /src/bus-proxyd/bus-policy.c
parentb4d23205f238e06aaa31264628e20669e714acad (diff)
treewide: auto-convert the simple cases to log_*_errno()
As a followup to 086891e5c1 "log: add an "error" parameter to all low-level logging calls and intrdouce log_error_errno() as log calls that take error numbers", use sed to convert the simple cases to use the new macros: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\("(.*)%s"(.*), strerror\(-([a-zA-Z_]+)\)\);/log_\1_errno(-\4, "\2%m"\3);/' Multi-line log_*() invocations are not covered. And we also should add log_unit_*_errno().
Diffstat (limited to 'src/bus-proxyd/bus-policy.c')
-rw-r--r--src/bus-proxyd/bus-policy.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/bus-proxyd/bus-policy.c b/src/bus-proxyd/bus-policy.c
index 3cfe9befb2..9a83efe845 100644
--- a/src/bus-proxyd/bus-policy.c
+++ b/src/bus-proxyd/bus-policy.c
@@ -95,7 +95,7 @@ static int file_load(Policy *p, const char *path) {
if (r == -EISDIR)
return r;
- log_error("Failed to load %s: %s", path, strerror(-r));
+ log_error_errno(-r, "Failed to load %s: %m", path);
return r;
}
@@ -106,7 +106,7 @@ static int file_load(Policy *p, const char *path) {
t = xml_tokenize(&q, &name, &xml_state, &line);
if (t < 0) {
- log_error("XML parse failure in %s: %s", path, strerror(-t));
+ log_error_errno(-t, "XML parse failure in %s: %m", path);
return t;
}
@@ -358,7 +358,7 @@ static int file_load(Policy *p, const char *path) {
r = get_user_creds(&u, &i->uid, NULL, NULL, NULL);
if (r < 0) {
- log_error("Failed to resolve user %s, ignoring policy: %s", u, strerror(-r));
+ log_error_errno(-r, "Failed to resolve user %s, ignoring policy: %m", u);
free(i);
} else {
PolicyItem *first;
@@ -390,7 +390,7 @@ static int file_load(Policy *p, const char *path) {
r = get_group_creds(&g, &i->gid);
if (r < 0) {
- log_error("Failed to resolve group %s, ignoring policy: %s", g, strerror(-r));
+ log_error_errno(-r, "Failed to resolve group %s, ignoring policy: %m", g);
free(i);
} else {
PolicyItem *first;
@@ -533,7 +533,7 @@ static int file_load(Policy *p, const char *path) {
r = get_user_creds(&u, &i->uid, NULL, NULL, NULL);
if (r < 0)
- log_error("Failed to resolve user %s: %s", name, strerror(-r));
+ log_error_errno(-r, "Failed to resolve user %s: %m", name);
else
i->uid_valid = true;
}
@@ -544,7 +544,7 @@ static int file_load(Policy *p, const char *path) {
r = get_group_creds(&g, &i->gid);
if (r < 0)
- log_error("Failed to resolve group %s: %s", name, strerror(-r));
+ log_error_errno(-r, "Failed to resolve group %s: %m", name);
else
i->gid_valid = true;
}
@@ -895,7 +895,7 @@ int policy_load(Policy *p, char **files) {
r = conf_files_list(&l, ".conf", NULL, *i, NULL);
if (r < 0) {
- log_error("Failed to get configuration file list: %s", strerror(-r));
+ log_error_errno(-r, "Failed to get configuration file list: %m");
return r;
}