summaryrefslogtreecommitdiff
path: root/deps/uv/src/unix/core.c
diff options
context:
space:
mode:
authorcjihrig <cjihrig@gmail.com>2018-04-02 13:33:48 -0400
committercjihrig <cjihrig@gmail.com>2018-04-04 20:02:17 -0400
commitae2b5bcb7c17a2d2a488f234c736201eed8200db (patch)
tree0c1ee75429727adc13cd61b63e866f45d9f71fbc /deps/uv/src/unix/core.c
parent67cce8d68ad091857b583aa8564d5ac0aaaf2bea (diff)
downloadandroid-node-v8-ae2b5bcb7c17a2d2a488f234c736201eed8200db.tar.gz
android-node-v8-ae2b5bcb7c17a2d2a488f234c736201eed8200db.tar.bz2
android-node-v8-ae2b5bcb7c17a2d2a488f234c736201eed8200db.zip
deps: upgrade libuv to 1.20.0
Notable changes: - uv_fs_copyfile() adds support for copy-on-write behavior. - uv_relative_path() now uses the long directory name for handle->dirw. - File operations on files > 2 GB on 32-bit platforms are working again. - uv_fs_fchmod() on Windows works on files with the Archive flag cleared. Fixes: https://github.com/nodejs/node/issues/19170 Fixes: https://github.com/nodejs/node/issues/19455 Fixes: https://github.com/nodejs/node/issues/12803 PR-URL: https://github.com/nodejs/node/pull/19758 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'deps/uv/src/unix/core.c')
-rw-r--r--deps/uv/src/unix/core.c27
1 files changed, 7 insertions, 20 deletions
diff --git a/deps/uv/src/unix/core.c b/deps/uv/src/unix/core.c
index 3741c1d06b..18c8fcd808 100644
--- a/deps/uv/src/unix/core.c
+++ b/deps/uv/src/unix/core.c
@@ -536,7 +536,7 @@ int uv__close_nocheckstdio(int fd) {
int uv__close(int fd) {
assert(fd > STDERR_FILENO); /* Catch stdio close bugs. */
#if defined(__MVS__)
- epoll_file_close(fd);
+ SAVE_ERRNO(epoll_file_close(fd));
#endif
return uv__close_nocheckstdio(fd);
}
@@ -1048,29 +1048,16 @@ int uv__dup2_cloexec(int oldfd, int newfd) {
int uv_os_homedir(char* buffer, size_t* size) {
uv_passwd_t pwd;
- char* buf;
size_t len;
int r;
- if (buffer == NULL || size == NULL || *size == 0)
- return UV_EINVAL;
-
- /* Check if the HOME environment variable is set first */
- buf = getenv("HOME");
-
- if (buf != NULL) {
- len = strlen(buf);
+ /* Check if the HOME environment variable is set first. The task of
+ performing input validation on buffer and size is taken care of by
+ uv_os_getenv(). */
+ r = uv_os_getenv("HOME", buffer, size);
- if (len >= *size) {
- *size = len + 1;
- return UV_ENOBUFS;
- }
-
- memcpy(buffer, buf, len + 1);
- *size = len;
-
- return 0;
- }
+ if (r != UV_ENOENT)
+ return r;
/* HOME is not set, so call uv__getpwuid_r() */
r = uv__getpwuid_r(&pwd);