mirror of
https://git.freebsd.org/ports.git
synced 2025-06-24 06:00:30 -04:00
21 lines
573 B
C
21 lines
573 B
C
--- lib/file/fileTempPosix.c.orig 2017-12-15 21:11:49 UTC
|
|
+++ lib/file/fileTempPosix.c
|
|
@@ -203,12 +203,17 @@ FileGetUserName(uid_t uid) // IN:
|
|
#if defined(__APPLE__)
|
|
memPoolSize = _PASSWORD_LEN;
|
|
#else
|
|
+ errno = 0;
|
|
memPoolSize = sysconf(_SC_GETPW_R_SIZE_MAX);
|
|
|
|
- if (memPoolSize <= 0) {
|
|
+ if ((errno != 0) || (memPoolSize == 0)) {
|
|
Warning("%s: sysconf(_SC_GETPW_R_SIZE_MAX) failed.\n", __FUNCTION__);
|
|
|
|
return NULL;
|
|
+ }
|
|
+
|
|
+ if (memPoolSize == -1) { // Unlimited; pick something reasonable
|
|
+ memPoolSize = 16 * 1024;
|
|
}
|
|
#endif
|
|
|