chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tmpfiles: move legacy flag-files handling to legacy.conf
[elogind.git]
/
src
/
core
/
path.c
diff --git
a/src/core/path.c
b/src/core/path.c
index 3936971b41a63c5325fbe7ec62da05e15144d164..767620ba754bb2f42184c0acd42fe0a4e083cbf8 100644
(file)
--- a/
src/core/path.c
+++ b/
src/core/path.c
@@
-124,7
+124,7
@@
int path_spec_fd_event(PathSpec *s, uint32_t events) {
int r = 0;
if (events != EPOLLIN) {
int r = 0;
if (events != EPOLLIN) {
- log_error("Got
I
nvalid poll event on inotify.");
+ log_error("Got
i
nvalid poll event on inotify.");
r = -EINVAL;
goto out;
}
r = -EINVAL;
goto out;
}
@@
-137,13
+137,15
@@
int path_spec_fd_event(PathSpec *s, uint32_t events) {
assert(l > 0);
assert(l > 0);
- if (!(buf = malloc(l))) {
+ buf = malloc(l);
+ if (!buf) {
log_error("Failed to allocate buffer: %m");
r = -errno;
goto out;
}
log_error("Failed to allocate buffer: %m");
r = -errno;
goto out;
}
- if ((k = read(s->inotify_fd, buf, l)) < 0) {
+ k = read(s->inotify_fd, buf, l);
+ if (k < 0) {
log_error("Failed to read inotify event: %m");
r = -errno;
goto out;
log_error("Failed to read inotify event: %m");
r = -errno;
goto out;
@@
-217,7
+219,8
@@
static void path_spec_mkdir(PathSpec *s, mode_t mode) {
if (s->type == PATH_EXISTS || s->type == PATH_EXISTS_GLOB)
return;
if (s->type == PATH_EXISTS || s->type == PATH_EXISTS_GLOB)
return;
- if ((r = mkdir_p_label(s->path, mode)) < 0)
+ r = mkdir_p_label(s->path, mode);
+ if (r < 0)
log_warning("mkdir(%s) failed: %s", s->path, strerror(-r));
}
log_warning("mkdir(%s) failed: %s", s->path, strerror(-r));
}
@@
-304,7
+307,8
@@
static int path_verify(Path *p) {
return 0;
if (!p->specs) {
return 0;
if (!p->specs) {
- log_error("%s lacks path setting. Refusing.", UNIT(p)->id);
+ log_error_unit(UNIT(p)->id,
+ "%s lacks path setting. Refusing.", UNIT(p)->id);
return -EINVAL;
}
return -EINVAL;
}