Skip to contentSkip to conversation

master - cov: log failing unlink

PATCH Zdenek Kabelac 1 participant 1 message Oct 15, 2018

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=70950bbd977020593b19ac704fd7571b4b2826cd
Commit:        70950bbd977020593b19ac704fd7571b4b2826cd
Parent:        f1ac130dc10ba22eaafd31e906b347a12b8cea16
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Mon Oct 15 16:21:01 2018 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Mon Oct 15 17:49:44 2018 +0200

cov: log failing unlink

---
 tools/pvscan.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
tools/pvscan.c +4 -2
index 6e80e3c..613a4c4 100644
@@ -225,7 +225,8 @@ static void _online_pvid_file_remove_devno(int major, int minor)
 
 		if (!strncmp(buf, buf_in, strlen(buf))) {
 			log_debug("Unlink pv online %s %s", buf, path);
-			unlink(path);
+			if (unlink(path))
+				log_sys_debug("unlink", path);
 			break;
 		}
 	}
@@ -248,7 +249,8 @@ static void _online_pvid_files_remove(void)
 
 		memset(path, 0, sizeof(path));
 		snprintf(path, sizeof(path), "%s/%s", _pvs_online_dir, de->d_name);
-		unlink(path);
+		if (unlink(path))
+			log_sys_debug("unlink", path);
 	}
 	if (closedir(dir))
 		log_sys_debug("closedir", _pvs_online_dir);