Skip to content

Commit a37072b

Browse files
committed
temp patch for freebsd testing
1 parent 69c1c33 commit a37072b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

deps/uv/src/unix/core.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,6 +1000,7 @@ int uv_os_homedir(char* buffer, size_t* size) {
10001000
uid_t uid;
10011001
size_t bufsize;
10021002
size_t len;
1003+
long initsize;
10031004
int r;
10041005

10051006
if (buffer == NULL || size == NULL || *size == 0)
@@ -1023,10 +1024,12 @@ int uv_os_homedir(char* buffer, size_t* size) {
10231024
}
10241025

10251026
/* HOME is not set, so call getpwuid() */
1026-
bufsize = sysconf(_SC_GETPW_R_SIZE_MAX);
1027+
initsize = sysconf(_SC_GETPW_R_SIZE_MAX);
10271028

1028-
if (bufsize <= 0)
1029-
return -EIO;
1029+
if (initsize <= 0)
1030+
bufsize = 4096;
1031+
else
1032+
bufsize = (unsigned int) initsize;
10301033

10311034
uid = getuid();
10321035
buf = NULL;

0 commit comments

Comments
 (0)