Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Pryor <jpryor@novell.com>2004-11-05 22:42:24 +0300
committerJonathan Pryor <jpryor@novell.com>2004-11-05 22:42:24 +0300
commita4e75d9a27a487ed05246fcd487df69227c56fba (patch)
treed94876306b86ed644014d622142cc0d292bdecdc /support/pwd.c
parent55a71babd783331b36e559825ec01b9f61b07983 (diff)
More Mac OS X portability fixes. On Linux, getgrnam_r & co. return the error
value directly. Mac OS X returns -1 and errno holds the error. Argh! Check both, for maximum portability. svn path=/trunk/mono/; revision=35731
Diffstat (limited to 'support/pwd.c')
-rw-r--r--support/pwd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/support/pwd.c b/support/pwd.c
index fc908958905..25380722ca1 100644
--- a/support/pwd.c
+++ b/support/pwd.c
@@ -163,7 +163,8 @@ Mono_Posix_Syscall_getpwnam_r (const char *name,
return -1;
}
buf = buf2;
- } while ((r = getpwnam_r (name, &_pwbuf, buf, buflen, pwbufp)) && r == ERANGE);
+ } while ((r = getpwnam_r (name, &_pwbuf, buf, buflen, pwbufp)) &&
+ recheck_range (r));
if (r == 0 && copy_passwd (pwbuf, &_pwbuf) == -1)
r = errno = ENOMEM;
@@ -198,7 +199,8 @@ Mono_Posix_Syscall_getpwuid_r (mph_uid_t uid,
return -1;
}
buf = buf2;
- } while ((r = getpwuid_r (uid, &_pwbuf, buf, buflen, pwbufp)) && r == ERANGE);
+ } while ((r = getpwuid_r (uid, &_pwbuf, buf, buflen, pwbufp)) &&
+ recheck_range (r));
if (r == 0 && copy_passwd (pwbuf, &_pwbuf) == -1)
r = errno = ENOMEM;