From 81350af83e8801701c5ab7a4e790f3708604f088 Mon Sep 17 00:00:00 2001 From: Jonathan Pryor Date: Wed, 27 Jun 2007 13:43:21 +0000 Subject: * grp.c, pwd.c: Only return failure if a documented errno is encountered. This fixes UnixUserInfo.GetLocalUsers() and UnixGroupInfo.GetLocalGroups() on systems missing the file /etc/default/nss (which generates ENOENT, which isn't documented, so therefore it's not a "real" error). * mph.h: Add mph_return_if_val_in_list5(). svn path=/trunk/mono/; revision=80868 --- support/pwd.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'support/pwd.c') diff --git a/support/pwd.c b/support/pwd.c index 2e0b373cf29..8eb27ef5ef7 100644 --- a/support/pwd.c +++ b/support/pwd.c @@ -237,8 +237,11 @@ int Mono_Posix_Syscall_setpwent (void) { errno = 0; - setpwent (); - return errno == 0 ? 0 : -1; + do { + setpwent (); + } while (errno == EINTR); + mph_return_if_val_in_list5(errno, EIO, EMFILE, ENFILE, ENOMEM, ERANGE); + return 0; } int -- cgit v1.2.3