diff options
author | Sumit Bose <sbose@redhat.com> | 2009-12-04 13:01:09 +0100 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2009-12-07 10:18:52 -0500 |
commit | b1a074deb982b536b41fadfcb72f363630b0b8c5 (patch) | |
tree | 780054615078a6c18d493ea153c222a4f671ab6e | |
parent | 457d7dc822de590ab024cef8df66135445a4b377 (diff) | |
download | sssd-b1a074deb982b536b41fadfcb72f363630b0b8c5.tar.gz sssd-b1a074deb982b536b41fadfcb72f363630b0b8c5.tar.xz sssd-b1a074deb982b536b41fadfcb72f363630b0b8c5.zip |
Do not treat missing proc files as errors.
-rw-r--r-- | server/util/find_uid.c | 10 |
1 files changed, 10 insertions, 0 deletions
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; } |