From 4a62c710b62a5a3c7a8a278b810b9d5b5a0c8f4f Mon Sep 17 00:00:00 2001 From: Michal Schmidt Date: Fri, 28 Nov 2014 19:57:32 +0100 Subject: treewide: another round of simplifications Using the same scripts as in f647962d64e "treewide: yet more log_*_errno + return simplifications". --- src/core/path.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/core/path.c') diff --git a/src/core/path.c b/src/core/path.c index ed03635a4..3624bfcac 100644 --- a/src/core/path.c +++ b/src/core/path.c @@ -168,10 +168,8 @@ int path_spec_fd_event(PathSpec *s, uint32_t revents) { return -EINVAL; } - if (ioctl(s->inotify_fd, FIONREAD, &l) < 0) { - log_error_errno(errno, "FIONREAD failed: %m"); - return -errno; - } + if (ioctl(s->inotify_fd, FIONREAD, &l) < 0) + return log_error_errno(errno, "FIONREAD failed: %m"); assert(l > 0); @@ -180,10 +178,8 @@ int path_spec_fd_event(PathSpec *s, uint32_t revents) { return log_oom(); k = read(s->inotify_fd, buf, l); - if (k < 0) { - log_error_errno(errno, "Failed to read inotify event: %m"); - return -errno; - } + if (k < 0) + return log_error_errno(errno, "Failed to read inotify event: %m"); e = (struct inotify_event*) buf; -- cgit v1.2.3