summaryrefslogtreecommitdiff
path: root/deps
diff options
context:
space:
mode:
authorBert Belder <bertbelder@gmail.com>2011-09-08 23:53:24 +0200
committerBert Belder <bertbelder@gmail.com>2011-09-08 23:53:40 +0200
commit0a127d6a694f2928f91d2ed51ef85a65768fdad3 (patch)
treef7252ed3a7858b2dac800848cbbc426a01918a5b /deps
parentb6e0433755eb97b04b308afefeee59b18f6fe341 (diff)
downloadnode-new-0a127d6a694f2928f91d2ed51ef85a65768fdad3.tar.gz
Upgrade libuv to 2d1c672e
Diffstat (limited to 'deps')
-rw-r--r--deps/uv/src/win/fs.c11
-rw-r--r--deps/uv/src/win/winapi.h5
-rw-r--r--deps/uv/test/test-fs.c2
3 files changed, 13 insertions, 5 deletions
diff --git a/deps/uv/src/win/fs.c b/deps/uv/src/win/fs.c
index b530370afd..92a9842855 100644
--- a/deps/uv/src/win/fs.c
+++ b/deps/uv/src/win/fs.c
@@ -118,8 +118,6 @@ static void uv_fs_req_init_sync(uv_loop_t* loop, uv_fs_t* req,
req->errorno = 0;
}
-/* this is where the CRT stores the current umask */
-extern int _umaskval;
void fs__open(uv_fs_t* req, const char* path, int flags, int mode) {
DWORD access;
@@ -128,7 +126,12 @@ void fs__open(uv_fs_t* req, const char* path, int flags, int mode) {
DWORD disposition;
DWORD attributes;
HANDLE file;
- int result;
+ int result, current_umask;
+
+ /* Obtain the active umask. umask() never fails and returns the previous */
+ /* umask. */
+ current_umask = umask(0);
+ umask(current_umask);
/* convert flags and mode to CreateFile parameters */
switch (flags & (_O_RDONLY | _O_WRONLY | _O_RDWR)) {
@@ -188,7 +191,7 @@ void fs__open(uv_fs_t* req, const char* path, int flags, int mode) {
attributes = FILE_ATTRIBUTE_NORMAL;
if (flags & _O_CREAT) {
- if (!((mode & ~_umaskval) & _S_IWRITE)) {
+ if (!((mode & ~current_umask) & _S_IWRITE)) {
attributes |= FILE_ATTRIBUTE_READONLY;
}
}
diff --git a/deps/uv/src/win/winapi.h b/deps/uv/src/win/winapi.h
index f04f37a58c..da3a95dbbd 100644
--- a/deps/uv/src/win/winapi.h
+++ b/deps/uv/src/win/winapi.h
@@ -4241,6 +4241,11 @@ typedef enum _FILE_INFORMATION_CLASS {
# define FILE_WRITE_ACCESS 0x0002
#endif
+#ifndef CTL_CODE
+# define CTL_CODE(device_type, function, method, access) \
+ (((device_type) << 16) | ((access) << 14) | ((function) << 2) | (method))
+#endif
+
#ifndef FSCTL_SET_REPARSE_POINT
# define FSCTL_SET_REPARSE_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, \
41, \
diff --git a/deps/uv/test/test-fs.c b/deps/uv/test/test-fs.c
index aaf262cb83..21afaeaa9a 100644
--- a/deps/uv/test/test-fs.c
+++ b/deps/uv/test/test-fs.c
@@ -1096,7 +1096,7 @@ TEST_IMPL(fs_symlink) {
ASSERT(r == 0);
#ifdef _WIN32
if (req.result == -1) {
- if (req.errorno == ENOTSUP) {
+ if (req.errorno == ENOSYS) {
/*
* Windows doesn't support symlinks on older versions.
* We just pass the test and bail out early if we get ENOTSUP.