diff options
author | Brad King <brad.king@kitware.com> | 2017-02-24 14:31:18 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2017-02-24 14:31:18 (GMT) |
commit | 8429068d7c37d06e53b871811760419ab3e36455 (patch) | |
tree | 7816dda07e96de420a213c4c3f1a37ca480890b4 /Utilities/cmlibuv/src/uv-common.c | |
parent | 32cb4172bd6b98810f9638076e978a6bc569f6ae (diff) | |
parent | 741b7621b3c71406359d75098f9bdf8d3567662f (diff) | |
download | CMake-8429068d7c37d06e53b871811760419ab3e36455.zip CMake-8429068d7c37d06e53b871811760419ab3e36455.tar.gz CMake-8429068d7c37d06e53b871811760419ab3e36455.tar.bz2 |
Merge topic 'update-libuv'
741b7621 Merge branch 'upstream-libuv' into update-libuv
1f661e87 libuv 2017-02-21 (52ae8264)
Diffstat (limited to 'Utilities/cmlibuv/src/uv-common.c')
-rw-r--r-- | Utilities/cmlibuv/src/uv-common.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/Utilities/cmlibuv/src/uv-common.c b/Utilities/cmlibuv/src/uv-common.c index 46d9546..bc7d137 100644 --- a/Utilities/cmlibuv/src/uv-common.c +++ b/Utilities/cmlibuv/src/uv-common.c @@ -512,8 +512,18 @@ void uv__fs_scandir_cleanup(uv_fs_t* req) { int uv_fs_scandir_next(uv_fs_t* req, uv_dirent_t* ent) { uv__dirent_t** dents; uv__dirent_t* dent; + unsigned int* nbufs; - unsigned int* nbufs = uv__get_nbufs(req); + /* Check to see if req passed */ + if (req->result < 0) + return req->result; + + /* Ptr will be null if req was canceled or no files found */ + if (!req->ptr) + return UV_EOF; + + nbufs = uv__get_nbufs(req); + assert(nbufs); dents = req->ptr; |