From e62d8c3944745ed276e6d4f33153009860e5cfc5 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Sun, 24 Mar 2013 19:45:16 -0400 Subject: Modernization Use _cleanup_ and wrap lines to ~80 chars and such. --- src/readahead/readahead-collect.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/readahead') diff --git a/src/readahead/readahead-collect.c b/src/readahead/readahead-collect.c index e2fd8dfd05..643a5a8cea 100644 --- a/src/readahead/readahead-collect.c +++ b/src/readahead/readahead-collect.c @@ -284,13 +284,16 @@ static int collect(const char *root) { goto finish; } - if (!(files = hashmap_new(string_hash_func, string_compare_func))) { + files = hashmap_new(string_hash_func, string_compare_func); + if (!files) { log_error("Failed to allocate set."); r = -ENOMEM; goto finish; } - if ((fanotify_fd = fanotify_init(FAN_CLOEXEC|FAN_NONBLOCK, O_RDONLY|O_LARGEFILE|O_CLOEXEC|O_NOATIME)) < 0) { + fanotify_fd = fanotify_init(FAN_CLOEXEC|FAN_NONBLOCK, + O_RDONLY|O_LARGEFILE|O_CLOEXEC|O_NOATIME); + if (fanotify_fd < 0) { log_error("Failed to create fanotify object: %m"); r = -errno; goto finish; @@ -302,7 +305,8 @@ static int collect(const char *root) { goto finish; } - if ((inotify_fd = open_inotify()) < 0) { + inotify_fd = open_inotify(); + if (inotify_fd < 0) { r = inotify_fd; goto finish; } -- cgit v1.2.3-54-g00ecf