X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=support%2Fpwd.c;h=e622027458dfa806dbdaf0525b27ce10484a3473;hb=feca28835d4e3cb2be67bdcbd4f54fee62c3797a;hp=38859e0d7c61bb3522adf62da87ec0bba2fe3b0c;hpb=fc4b07f20f9e79fe99d4b520bb5ff8b5e80b10f6;p=mono.git diff --git a/support/pwd.c b/support/pwd.c index 38859e0d7c6..e622027458d 100644 --- a/support/pwd.c +++ b/support/pwd.c @@ -13,21 +13,11 @@ #include #include +#include "map.h" #include "mph.h" G_BEGIN_DECLS -struct Mono_Posix_Syscall__Passwd { - /* string */ char *pw_name; - /* string */ char *pw_passwd; - /* uid_t */ mph_uid_t pw_uid; - /* gid_t */ mph_gid_t pw_gid; - /* string */ char *pw_gecos; - /* string */ char *pw_dir; - /* string */ char *pw_shell; - /* string */ char *_pw_buf_; -}; - static const size_t passwd_offsets[] = { offsetof (struct passwd, pw_name), @@ -247,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 @@ -256,7 +249,9 @@ Mono_Posix_Syscall_endpwent (void) { errno = 0; endpwent (); - return errno == 0 ? 0 : -1; + if (errno == EIO) + return -1; + return 0; } G_END_DECLS