Commit 1b0c6b3c by Serge Hallyn Committed by Stéphane Graber

lvm: supress warnings about leaked files

Closes #1283 Signed-off-by: 's avatarSerge Hallyn <serge@hallyn.com>
parent 8ee3d943
......@@ -105,6 +105,7 @@ extern char *dir_new_path(char *src, const char *oldname, const char *name,
tp = NULL;
}
(void)setenv("LVM_SUPPRESS_FD_WARNINGS", "1", 1);
if (!tp)
execlp("lvcreate", "lvcreate", "-L", sz, vg, "-n", lv, (char *)NULL);
else
......@@ -256,6 +257,7 @@ int lvm_snapshot(const char *orig, const char *path, uint64_t size)
return -1;
}
(void)setenv("LVM_SUPPRESS_FD_WARNINGS", "1", 1);
if (!ret) {
ret = execlp("lvcreate", "lvcreate", "-s", "-L", sz, "-n", lv, orig, (char *)NULL);
} else {
......@@ -356,6 +358,7 @@ int lvm_destroy(struct bdev *orig)
if ((pid = fork()) < 0)
return -1;
if (!pid) {
(void)setenv("LVM_SUPPRESS_FD_WARNINGS", "1", 1);
execlp("lvremove", "lvremove", "-f", orig->src, (char *)NULL);
exit(EXIT_FAILURE);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment