summaryrefslogtreecommitdiffstats
path: root/sys-utils/lsns.c
diff options
context:
space:
mode:
authorKarel Zak2016-08-15 11:02:18 +0200
committerKarel Zak2016-08-15 11:02:18 +0200
commit3082f8518f2739e9f68e660f1749acdd2b9d7a97 (patch)
treea43ea4b8e943eb344a11891417515f287baf615b /sys-utils/lsns.c
parenttests: mark build-in paths test as optional (diff)
downloadkernel-qcow2-util-linux-3082f8518f2739e9f68e660f1749acdd2b9d7a97.tar.gz
kernel-qcow2-util-linux-3082f8518f2739e9f68e660f1749acdd2b9d7a97.tar.xz
kernel-qcow2-util-linux-3082f8518f2739e9f68e660f1749acdd2b9d7a97.zip
lsns: missing ns/<name> is not error
For example user namespace is optional it does not make sense to ignore process completely if the ns/user file is missing. Reported-by: MichaƂ Bartoszkiewicz <mbartoszkiewicz@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'sys-utils/lsns.c')
-rw-r--r--sys-utils/lsns.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys-utils/lsns.c b/sys-utils/lsns.c
index c79bde383..75c04f8f8 100644
--- a/sys-utils/lsns.c
+++ b/sys-utils/lsns.c
@@ -202,7 +202,7 @@ static inline const struct colinfo *get_column_info(unsigned num)
return &infos[ get_column_id(num) ];
}
-static ino_t get_ns_ino(int dir, const char *nsname, ino_t *ino)
+static int get_ns_ino(int dir, const char *nsname, ino_t *ino)
{
struct stat st;
char path[16];
@@ -267,7 +267,7 @@ static int read_process(struct lsns *ls, pid_t pid)
continue;
rc = get_ns_ino(dirfd(dir), ns_names[i], &p->ns_ids[i]);
- if (rc && rc != -EACCES)
+ if (rc && rc != -EACCES && rc != -ENOENT)
goto done;
rc = 0;
}