]> sourceware.org Git - lvm2.git/commitdiff
cov: check closedir result
authorZdenek Kabelac <zkabelac@redhat.com>
Mon, 15 Oct 2018 14:19:49 +0000 (16:19 +0200)
committerZdenek Kabelac <zkabelac@redhat.com>
Mon, 15 Oct 2018 15:49:44 +0000 (17:49 +0200)
Log problems around failing closedir().

tools/pvscan.c

index da630740f579aa8d775f2f954ada12babc6facb1..6e80e3c8c48d4da263c52d9120e3d00822462362 100644 (file)
@@ -229,7 +229,8 @@ static void _online_pvid_file_remove_devno(int major, int minor)
                        break;
                }
        }
-       closedir(dir);
+       if (closedir(dir))
+               log_sys_debug("closedir", _pvs_online_dir);
 }
 
 static void _online_pvid_files_remove(void)
@@ -249,7 +250,8 @@ static void _online_pvid_files_remove(void)
                snprintf(path, sizeof(path), "%s/%s", _pvs_online_dir, de->d_name);
                unlink(path);
        }
-       closedir(dir);
+       if (closedir(dir))
+               log_sys_debug("closedir", _pvs_online_dir);
 }
 
 static void _online_pvid_file_create(struct device *dev)
@@ -338,10 +340,12 @@ static int _online_pvid_files_missing(void)
        while ((de = readdir(dir))) {
                if (de->d_name[0] == '.')
                        continue;
-               closedir(dir);
+               if (closedir(dir))
+                       log_sys_debug("closedir", _pvs_online_dir);
                return 0;
        }
-       closedir(dir);
+       if (closedir(dir))
+               log_sys_debug("closedir", _pvs_online_dir);
        return 1;
 }
 
This page took 0.040749 seconds and 5 git commands to generate.