summaryrefslogtreecommitdiffstats
path: root/sys-utils/nsenter.c
diff options
context:
space:
mode:
authorKarel Zak2017-11-28 10:53:35 +0100
committerKarel Zak2017-11-28 10:53:35 +0100
commitb9e4ee42c285e73b36879a96b9cde43edb0f90c6 (patch)
treeda74e544bff6cce39bc086d31db50f36c58fbe98 /sys-utils/nsenter.c
parentdmesg: fix compiler warning [-Wuninitialized] (diff)
downloadkernel-qcow2-util-linux-b9e4ee42c285e73b36879a96b9cde43edb0f90c6.tar.gz
kernel-qcow2-util-linux-b9e4ee42c285e73b36879a96b9cde43edb0f90c6.tar.xz
kernel-qcow2-util-linux-b9e4ee42c285e73b36879a96b9cde43edb0f90c6.zip
nsenter: fix compiler warning [-Wuninitialized]
sys-utils/nsenter.c: In function ‘is_same_namespace’: sys-utils/nsenter.c:170:2: warning: ‘b_ino’ may be used uninitialized in this function [-Wuninitialized] sys-utils/nsenter.c:170:2: warning: ‘a_ino’ may be used uninitialized in this function [-Wuninitialized] Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'sys-utils/nsenter.c')
-rw-r--r--sys-utils/nsenter.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys-utils/nsenter.c b/sys-utils/nsenter.c
index 9c452c1d1..ec50cb330 100644
--- a/sys-utils/nsenter.c
+++ b/sys-utils/nsenter.c
@@ -157,7 +157,7 @@ static int get_ns_ino(const char *path, ino_t *ino)
static int is_same_namespace(pid_t a, pid_t b, const char *type)
{
char path[PATH_MAX];
- ino_t a_ino, b_ino;
+ ino_t a_ino = 0, b_ino = 0;
snprintf(path, sizeof(path), "/proc/%u/%s", a, type);
if (get_ns_ino(path, &a_ino) != 0)