chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
treewide: use log_*_errno whenever %m is in the format string
[elogind.git]
/
src
/
journal
/
sd-journal.c
diff --git
a/src/journal/sd-journal.c
b/src/journal/sd-journal.c
index cf21c4d899891e28b03697b22b13736a462147f9..bb410ed6ec25ffef79599f7e154beaf4bf5ae460 100644
(file)
--- a/
src/journal/sd-journal.c
+++ b/
src/journal/sd-journal.c
@@
-884,7
+884,7
@@
static int real_journal_next(sd_journal *j, direction_t direction) {
r = next_beyond_location(j, f, direction, &o, &p);
if (r < 0) {
r = next_beyond_location(j, f, direction, &o, &p);
if (r < 0) {
- log_debug
("Can't iterate through %s, ignoring: %s", f->path, strerror(-r)
);
+ log_debug
_errno(r, "Can't iterate through %s, ignoring: %m", f->path
);
remove_file_real(j, f);
continue;
} else if (r == 0)
remove_file_real(j, f);
continue;
} else if (r == 0)
@@
-1410,7
+1410,7
@@
static int add_directory(sd_journal *j, const char *prefix, const char *dirname)
d = opendir(path);
if (!d) {
d = opendir(path);
if (!d) {
- log_debug
(
"Failed to open %s: %m", path);
+ log_debug
_errno(errno,
"Failed to open %s: %m", path);
if (errno == ENOENT)
return 0;
return -errno;
if (errno == ENOENT)
return 0;
return -errno;
@@
-1456,7
+1456,7
@@
static int add_directory(sd_journal *j, const char *prefix, const char *dirname)
de = readdir(d);
if (!de && errno != 0) {
r = -errno;
de = readdir(d);
if (!de && errno != 0) {
r = -errno;
- log_debug
(
"Failed to read directory %s: %m", m->path);
+ log_debug
_errno(errno,
"Failed to read directory %s: %m", m->path);
return r;
}
if (!de)
return r;
}
if (!de)
@@
-1466,8
+1466,8
@@
static int add_directory(sd_journal *j, const char *prefix, const char *dirname)
dirent_is_file_with_suffix(de, ".journal~")) {
r = add_file(j, m->path, de->d_name);
if (r < 0) {
dirent_is_file_with_suffix(de, ".journal~")) {
r = add_file(j, m->path, de->d_name);
if (r < 0) {
- log_debug
("Failed to add file %s/%s: %s
",
-
m->path, de->d_name, strerror(-r)
);
+ log_debug
_errno(r, "Failed to add file %s/%s: %m
",
+
m->path, de->d_name
);
r = set_put_error(j, r);
if (r < 0)
return r;
r = set_put_error(j, r);
if (r < 0)
return r;
@@
-1546,7
+1546,7
@@
static int add_root_directory(sd_journal *j, const char *p) {
de = readdir(d);
if (!de && errno != 0) {
r = -errno;
de = readdir(d);
if (!de && errno != 0) {
r = -errno;
- log_debug
(
"Failed to read directory %s: %m", m->path);
+ log_debug
_errno(errno,
"Failed to read directory %s: %m", m->path);
return r;
}
if (!de)
return r;
}
if (!de)
@@
-1556,8
+1556,8
@@
static int add_root_directory(sd_journal *j, const char *p) {
dirent_is_file_with_suffix(de, ".journal~")) {
r = add_file(j, m->path, de->d_name);
if (r < 0) {
dirent_is_file_with_suffix(de, ".journal~")) {
r = add_file(j, m->path, de->d_name);
if (r < 0) {
- log_debug
("Failed to add file %s/%s: %s
",
-
m->path, de->d_name, strerror(-r)
);
+ log_debug
_errno(r, "Failed to add file %s/%s: %m
",
+
m->path, de->d_name
);
r = set_put_error(j, r);
if (r < 0)
return r;
r = set_put_error(j, r);
if (r < 0)
return r;
@@
-1567,7
+1567,7
@@
static int add_root_directory(sd_journal *j, const char *p) {
r = add_directory(j, m->path, de->d_name);
if (r < 0)
r = add_directory(j, m->path, de->d_name);
if (r < 0)
- log_debug
("Failed to add directory %s/%s: %s", m->path, de->d_name, strerror(-r)
);
+ log_debug
_errno(r, "Failed to add directory %s/%s: %m", m->path, de->d_name
);
}
}
}
}
@@
-1810,7
+1810,7
@@
_public_ int sd_journal_open_files(sd_journal **ret, const char **paths, int fla
STRV_FOREACH(path, paths) {
r = add_any_file(j, *path);
if (r < 0) {
STRV_FOREACH(path, paths) {
r = add_any_file(j, *path);
if (r < 0) {
- log_error
("Failed to open %s: %s", *path, strerror(-r)
);
+ log_error
_errno(r, "Failed to open %s: %m", *path
);
goto fail;
}
}
goto fail;
}
}
@@
-2218,8
+2218,8
@@
static void process_inotify_event(sd_journal *j, struct inotify_event *e) {
if (e->mask & (IN_CREATE|IN_MOVED_TO|IN_MODIFY|IN_ATTRIB)) {
r = add_file(j, d->path, e->name);
if (r < 0) {
if (e->mask & (IN_CREATE|IN_MOVED_TO|IN_MODIFY|IN_ATTRIB)) {
r = add_file(j, d->path, e->name);
if (r < 0) {
- log_debug
("Failed to add file %s/%s: %s
",
-
d->path, e->name, strerror(-r)
);
+ log_debug
_errno(r, "Failed to add file %s/%s: %m
",
+
d->path, e->name
);
set_put_error(j, r);
}
set_put_error(j, r);
}
@@
-2227,7
+2227,7
@@
static void process_inotify_event(sd_journal *j, struct inotify_event *e) {
r = remove_file(j, d->path, e->name);
if (r < 0)
r = remove_file(j, d->path, e->name);
if (r < 0)
- log_debug
("Failed to remove file %s/%s: %s", d->path, e->name, strerror(-r)
);
+ log_debug
_errno(r, "Failed to remove file %s/%s: %m", d->path, e->name
);
}
} else if (!d->is_root && e->len == 0) {
}
} else if (!d->is_root && e->len == 0) {
@@
-2237,7
+2237,7
@@
static void process_inotify_event(sd_journal *j, struct inotify_event *e) {
if (e->mask & (IN_DELETE_SELF|IN_MOVE_SELF|IN_UNMOUNT)) {
r = remove_directory(j, d);
if (r < 0)
if (e->mask & (IN_DELETE_SELF|IN_MOVE_SELF|IN_UNMOUNT)) {
r = remove_directory(j, d);
if (r < 0)
- log_debug
("Failed to remove directory %s: %s", d->path, strerror(-r)
);
+ log_debug
_errno(r, "Failed to remove directory %s: %m", d->path
);
}
}
@@
-2248,7
+2248,7
@@
static void process_inotify_event(sd_journal *j, struct inotify_event *e) {
if (e->mask & (IN_CREATE|IN_MOVED_TO|IN_MODIFY|IN_ATTRIB)) {
r = add_directory(j, d->path, e->name);
if (r < 0)
if (e->mask & (IN_CREATE|IN_MOVED_TO|IN_MODIFY|IN_ATTRIB)) {
r = add_directory(j, d->path, e->name);
if (r < 0)
- log_debug
("Failed to add directory %s/%s: %s", d->path, e->name, strerror(-r)
);
+ log_debug
_errno(r, "Failed to add directory %s/%s: %m", d->path, e->name
);
}
}
}
}