]> git.ipfire.org Git - thirdparty/util-linux.git/blobdiff - sys-utils/chmem.c
libmount: add support for MS_REMOUNT on --all
[thirdparty/util-linux.git] / sys-utils / chmem.c
index e5eab096a471f371620b6934475327b230194349..861f6cfd22906de43eb08d560bcaadf0bec2c72e 100644 (file)
@@ -354,7 +354,7 @@ static void __attribute__((__noreturn__)) usage(void)
 
 int main(int argc, char **argv)
 {
-       struct chmem_desc _desc = { }, *desc = &_desc;
+       struct chmem_desc _desc = { }, *desc = &_desc;
        int cmd = CMD_NONE, zone_id = -1;
        char *zone = NULL;
        int c, rc;
@@ -428,7 +428,7 @@ int main(int argc, char **argv)
 
 
        /* The valid_zones sysfs attribute was introduced with kernel 3.18 */
-       if (ul_path_access(desc->sysmem, F_OK, "memory0/valid_zones"))
+       if (ul_path_access(desc->sysmem, F_OK, "memory0/valid_zones") == 0)
                desc->have_zones = 1;
        else if (zone)
                warnx(_("zone ignored, no valid_zones sysfs attribute present"));