From d64a2e5ebaccd872912a8dea9006f2a7724dd830 Mon Sep 17 00:00:00 2001 From: Sumit Bose Date: Fri, 4 Dec 2009 13:01:09 +0100 Subject: Do not treat missing proc files as errors. --- server/util/find_uid.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'server') diff --git a/server/util/find_uid.c b/server/util/find_uid.c index 2fead50a3..626d37f6f 100644 --- a/server/util/find_uid.c +++ b/server/util/find_uid.c @@ -87,6 +87,11 @@ static errno_t get_uid_from_pid(const pid_t pid, uid_t *uid) ret = lstat(path, &stat_buf); if (ret == -1) { + if (errno == ENOENT) { + DEBUG(7, ("Proc file [%s] is not available anymore, continuing.\n", + path)); + return EOK; + } DEBUG(1, ("lstat failed [%d][%s].\n", errno, strerror(errno))); return errno; } @@ -98,6 +103,11 @@ static errno_t get_uid_from_pid(const pid_t pid, uid_t *uid) fd = open(path, O_RDONLY); if (fd == -1) { + if (errno == ENOENT) { + DEBUG(7, ("Proc file [%s] is not available anymore, continuing.\n", + path)); + return EOK; + } DEBUG(1, ("open failed [%d][%s].\n", errno, strerror(errno))); return errno; } -- cgit