Skip to content

Commit

Permalink
temp patch for freebsd testing
Browse files Browse the repository at this point in the history
  • Loading branch information
cjihrig committed Jun 4, 2015
1 parent 69c1c33 commit a37072b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions deps/uv/src/unix/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1000,6 +1000,7 @@ int uv_os_homedir(char* buffer, size_t* size) {
uid_t uid;
size_t bufsize;
size_t len;
long initsize;
int r;

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

/* HOME is not set, so call getpwuid() */
bufsize = sysconf(_SC_GETPW_R_SIZE_MAX);
initsize = sysconf(_SC_GETPW_R_SIZE_MAX);

if (bufsize <= 0)
return -EIO;
if (initsize <= 0)
bufsize = 4096;
else
bufsize = (unsigned int) initsize;

This comment has been minimized.

Copy link
@bnoordhuis

bnoordhuis Jun 4, 2015

Member

Can you use (size_t) here? sizeof(unsigned int) isn't always sizeof(size_t).


uid = getuid();
buf = NULL;
Expand Down

0 comments on commit a37072b

Please sign in to comment.