Browse Source

uv: upgrade to 0ba44cf

Ben Noordhuis 14 years ago
parent
commit
fe4b7420a3
  1. 41
      deps/uv/src/ev/config_linux.h
  2. 8
      deps/uv/src/unix/fs.c

41
deps/uv/src/ev/config_linux.h

@ -2,12 +2,7 @@
/* config.h.in. Generated from configure.ac by autoheader. */
#include <linux/version.h>
#define LINUX_VERSION_CODE_FOR(major, minor, patch) \
(((major & 255) << 16) | ((minor & 255) << 8) | (patch & 255))
#define LINUX_VERSION_AT_LEAST(major, minor, patch) \
(LINUX_VERSION_CODE >= LINUX_VERSION_CODE_FOR(major, minor, patch))
#include <features.h>
/* Define to 1 if you have the `clock_gettime' function. */
/* #undef HAVE_CLOCK_GETTIME */
@ -18,14 +13,26 @@
/* Define to 1 if you have the <dlfcn.h> header file. */
#define HAVE_DLFCN_H 1
/* Define to 1 if you have the `epoll_ctl' function. */
/* epoll_ctl(2) is available if kernel >= 2.6.9 and glibc >= 2.4 */
#if LINUX_VERSION_CODE >= 0x020609 && __GLIBC_PREREQ(2, 4)
#define HAVE_EPOLL_CTL 1
/* Define to 1 if you have the `eventfd' function. */
#define HAVE_EVENTFD LINUX_VERSION_AT_LEAST(2, 6, 22)
/* Define to 1 if you have the `inotify_init' function. */
#define HAVE_INOTIFY_INIT LINUX_VERSION_AT_LEAST(2, 6, 13)
#else
#define HAVE_EPOLL_CTL 0
#endif
/* eventfd(2) is available if kernel >= 2.6.22 and glibc >= 2.8 */
#if LINUX_VERSION_CODE >= 0x020616 && __GLIBC_PREREQ(2, 8)
#define HAVE_EVENTFD 1
#else
#define HAVE_EVENTFD 0
#endif
/* inotify_init(2) is available if kernel >= 2.6.13 and glibc >= 2.4 */
#if LINUX_VERSION_CODE >= 0x02060d && __GLIBC_PREREQ(2, 4)
#define HAVE_INOTIFY_INIT 1
#else
#define HAVE_INOTIFY_INIT 0
#endif
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
@ -60,8 +67,12 @@
/* Define to 1 if you have the `select' function. */
#define HAVE_SELECT 1
/* Define to 1 if you have the `signalfd' function. */
#define HAVE_SIGNALFD LINUX_VERSION_AT_LEAST(2, 6, 22)
/* signalfd(2) is available if kernel >= 2.6.22 and glibc >= 2.8 */
#if LINUX_VERSION_CODE >= 0x020616 && __GLIBC_PREREQ(2, 8)
#define HAVE_SIGNALFD 1
#else
#define HAVE_SIGNALFD 0
#endif
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1

8
deps/uv/src/unix/fs.c

@ -304,6 +304,7 @@ int uv_fs_readdir(uv_fs_t* req, const char* path, int flags, uv_fs_cb cb) {
int r;
struct dirent* entry;
size_t size = 0;
size_t d_namlen = 0;
uv_fs_req_init(req, UV_FS_READDIR, cb);
@ -325,11 +326,12 @@ int uv_fs_readdir(uv_fs_t* req, const char* path, int flags, uv_fs_cb cb) {
}
while ((entry = readdir(dir))) {
req->ptr = realloc(req->ptr, size + entry->d_namlen + 1);
d_namlen = strlen(entry->d_name);
req->ptr = realloc(req->ptr, size + d_namlen + 1);
/* TODO check ENOMEM */
/* TODO skip . and .. */
memcpy((char*)req->ptr + size, entry->d_name, entry->d_namlen);
size += entry->d_namlen;
memcpy((char*)req->ptr + size, entry->d_name, d_namlen);
size += d_namlen;
((char*)req->ptr)[size] = '\0';
size++;
}

Loading…
Cancel
Save