summaryrefslogtreecommitdiff
path: root/src/core/path.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-01-04 20:46:49 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-01-06 13:52:47 -0500
commit15f55e8092159cec010fc80b676bc2e0de3ecbdf (patch)
treeda525f0535ace5c4bd6d0f7dd96b176b9eeb9c76 /src/core/path.c
parent4f0eedb703848597d004da506b7636719892a958 (diff)
core/path: modernize style
Diffstat (limited to 'src/core/path.c')
-rw-r--r--src/core/path.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/core/path.c b/src/core/path.c
index 3936971b41..d65339771e 100644
--- 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) {
- log_error("Got Invalid poll event on inotify.");
+ log_error("Got invalid poll event on inotify.");
r = -EINVAL;
goto out;
}
@@ -137,13 +137,15 @@ int path_spec_fd_event(PathSpec *s, uint32_t events) {
assert(l > 0);
- if (!(buf = malloc(l))) {
+ buf = malloc(l);
+ if (!buf) {
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;
@@ -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 ((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));
}