From: Karel Zak Date: Mon, 15 Aug 2016 09:02:18 +0000 (+0200) Subject: lsns: missing ns/ is not error X-Git-Tag: v2.28.2~17 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=3cd98e951ad1c469c8a0c973c0afa1f892cb9491;p=thirdparty%2Futil-linux.git lsns: missing ns/ 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 Signed-off-by: Karel Zak --- diff --git a/sys-utils/lsns.c b/sys-utils/lsns.c index 9621425271..443efde507 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; }