X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Freadahead%2Freadahead-collect.c;h=5d37bb75f3c3da7b11f507906afd892d3d6899ad;hb=4b357e15876b730343db08719c877fdb45b6ad42;hp=02ecbe56c9be8a03db9d53e38a8574d2aae5d215;hpb=4826f0b7b5c0aefa08b8cc7ef64d69027f84da2c;p=elogind.git diff --git a/src/readahead/readahead-collect.c b/src/readahead/readahead-collect.c index 02ecbe56c..5d37bb75f 100644 --- a/src/readahead/readahead-collect.c +++ b/src/readahead/readahead-collect.c @@ -44,6 +44,10 @@ #include #include +#ifdef HAVE_LINUX_BTRFS_H +#include +#endif + #ifdef HAVE_FANOTIFY_INIT #include #endif @@ -479,8 +483,9 @@ static int collect(const char *root) { } entry->bin = (entrytime - starttime) / 2000000; - if ((k = hashmap_put(files, p, entry)) < 0) { - log_warning("set_put() failed: %s", strerror(-k)); + k = hashmap_put(files, p, entry); + if (k < 0) { + log_warning("hashmap_put() failed: %s", strerror(-k)); free(p); } } @@ -505,7 +510,7 @@ done: on_ssd = fs_on_ssd(root) > 0; log_debug("On SSD: %s", yes_no(on_ssd)); - on_btrfs = statfs(root, &sfs) >= 0 && sfs.f_type == (__SWORD_TYPE) BTRFS_SUPER_MAGIC; + on_btrfs = statfs(root, &sfs) >= 0 && F_TYPE_CMP(sfs.f_type, BTRFS_SUPER_MAGIC); log_debug("On btrfs: %s", yes_no(on_btrfs)); if (asprintf(&pack_fn_new, "%s/.readahead.new", root) < 0) {