Showing with 10 additions and 11 deletions.
  1. +0 −1 include/uv-private/uv-unix.h
  2. +0 −1 include/uv-private/uv-win.h
  3. +1 −0 include/uv.h
  4. +1 −1 src/fs-poll.c
  5. +4 −4 src/win/fs.c
  6. +4 −4 test/test-fs.c
@@ -295,7 +295,6 @@ typedef struct {
double atime; \
double mtime; \
struct uv__work work_req; \
struct stat statbuf; \

#define UV_WORK_PRIVATE_FIELDS \
struct uv__work work_req;
@@ -555,7 +555,6 @@ RB_HEAD(uv_timer_tree_s, uv_timer_s);
size_t length; \
int64_t offset; \
}; \
struct _stati64 stat; \
struct { \
double atime; \
double mtime; \
@@ -1515,6 +1515,7 @@ struct uv_fs_s {
void* ptr;
const char* path;
uv_err_code errorno;
uv_statbuf_t statbuf; /* Stores the result of uv_fs_stat and uv_fs_fstat. */
UV_FS_PRIVATE_FIELDS
};

@@ -158,7 +158,7 @@ static void poll_cb(uv_fs_t* req) {
goto out;
}

statbuf = req->ptr;
statbuf = &req->statbuf;

if (ctx->busy_polling != 0)
if (ctx->busy_polling < 0 || !statbuf_eq(&ctx->statbuf, statbuf))
@@ -889,7 +889,7 @@ INLINE static void fs__stat_impl(uv_fs_t* req, int do_lstat) {
return;
}

if (fs__stat_handle(handle, &req->stat) != 0) {
if (fs__stat_handle(handle, &req->statbuf) != 0) {
DWORD error = GetLastError();
if (do_lstat && error == ERROR_SYMLINK_NOT_SUPPORTED) {
/* We opened a reparse point but it was not a symlink. Try again. */
@@ -904,7 +904,7 @@ INLINE static void fs__stat_impl(uv_fs_t* req, int do_lstat) {
return;
}

req->ptr = &req->stat;
req->ptr = &req->statbuf;
req->result = 0;
CloseHandle(handle);
}
@@ -935,12 +935,12 @@ static void fs__fstat(uv_fs_t* req) {
return;
}

if (fs__stat_handle(handle, &req->stat) != 0) {
if (fs__stat_handle(handle, &req->statbuf) != 0) {
SET_REQ_WIN32_ERROR(req, GetLastError());
return;
}

req->ptr = &req->stat;
req->ptr = &req->statbuf;
req->result = 0;
}

@@ -107,13 +107,13 @@ static char test_buf[] = "test-buffer\n";
static void check_permission(const char* filename, int mode) {
int r;
uv_fs_t req;
struct stat* s;
uv_statbuf_t* s;

r = uv_fs_stat(uv_default_loop(), &req, filename, NULL);
ASSERT(r == 0);
ASSERT(req.result == 0);

s = req.ptr;
s = &req.statbuf;
#ifdef _WIN32
/*
* On Windows, chmod can only modify S_IWUSR (_S_IWRITE) bit,
@@ -543,15 +543,15 @@ TEST_IMPL(fs_file_loop) {
}

static void check_utime(const char* path, double atime, double mtime) {
struct stat* s;
uv_statbuf_t* s;
uv_fs_t req;
int r;

r = uv_fs_stat(loop, &req, path, NULL);
ASSERT(r == 0);

ASSERT(req.result == 0);
s = req.ptr;
s = &req.statbuf;

#if defined(_WIN32) || defined(_AIX)
ASSERT(s->st_atime == atime);