[lxc-devel] [lxc/master] lvm: supress warnings about leaked files
hallyn on Github
lxc-bot at linuxcontainers.org
Sat Nov 26 06:11:07 UTC 2016
A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 363 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20161126/fe959479/attachment.bin>
-------------- next part --------------
From 79816ab3f4ba867fdbc0baa63d22df7f407314fb Mon Sep 17 00:00:00 2001
From: Serge Hallyn <serge at hallyn.com>
Date: Sat, 26 Nov 2016 00:07:15 -0600
Subject: [PATCH] lvm: supress warnings about leaked files
Closes #1283
Signed-off-by: Serge Hallyn <serge at hallyn.com>
---
src/lxc/bdev/lxclvm.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/lxc/bdev/lxclvm.c b/src/lxc/bdev/lxclvm.c
index 3d41b10..db0e21c 100644
--- a/src/lxc/bdev/lxclvm.c
+++ b/src/lxc/bdev/lxclvm.c
@@ -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);
}
More information about the lxc-devel
mailing list