diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-03-24 19:45:16 -0400 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-03-31 14:36:12 -0400 |
commit | e62d8c3944745ed276e6d4f33153009860e5cfc5 (patch) | |
tree | e7f70ed3b80581017b6340723ab6f1d6b9c30bad /src/readahead/readahead-collect.c | |
parent | 3c8bed4ee061f96acb4d70a591a9849bddd2a659 (diff) |
Modernization
Use _cleanup_ and wrap lines to ~80 chars and such.
Diffstat (limited to 'src/readahead/readahead-collect.c')
-rw-r--r-- | src/readahead/readahead-collect.c | 10 |
1 files changed, 7 insertions, 3 deletions
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; } |