X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Freadahead%2Freadahead-collect.c;h=643a5a8ceaa560d8f87b58dca802a3c12fa750a2;hp=e2fd8dfd05f2dfd17c60a77e5520fca47cb41097;hb=e62d8c394474;hpb=3c8bed4ee061f96acb4d70a591a9849bddd2a659 diff --git a/src/readahead/readahead-collect.c b/src/readahead/readahead-collect.c index e2fd8dfd0..643a5a8ce 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; }