diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2012-04-12 00:59:38 +0200 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2012-04-12 00:59:38 +0200 |
commit | e9dcfd4bd280fe3e819b2c992f33dad22bb8a967 (patch) | |
tree | 2b4748be10afd1640a271b0e7b382784d5feae5f /deps/uv/src/unix/sunos.c | |
parent | 3ec84a11f8ce70bde3a480a80cbe0875f8ea08ae (diff) | |
download | android-node-v8-e9dcfd4bd280fe3e819b2c992f33dad22bb8a967.tar.gz android-node-v8-e9dcfd4bd280fe3e819b2c992f33dad22bb8a967.tar.bz2 android-node-v8-e9dcfd4bd280fe3e819b2c992f33dad22bb8a967.zip |
Revert "deps: upgrade libuv to 3c41597"
This reverts commit 0db4dc0024eaa538bf4913d6bf256a18126de2ba.
This commit makes a lot of tests fail due to reference counting errors. It's
not worth it to debug because the reference counting scheme is due to change
soon anyway.
Diffstat (limited to 'deps/uv/src/unix/sunos.c')
-rw-r--r-- | deps/uv/src/unix/sunos.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/deps/uv/src/unix/sunos.c b/deps/uv/src/unix/sunos.c index 0057e68651..37fdd8982f 100644 --- a/deps/uv/src/unix/sunos.c +++ b/deps/uv/src/unix/sunos.c @@ -37,7 +37,6 @@ #include <sys/time.h> #include <unistd.h> #include <kstat.h> -#include <fcntl.h> #if HAVE_PORTS_FS # include <sys/port.h> @@ -191,7 +190,7 @@ int uv_fs_event_init(uv_loop_t* loop, } -void uv__fs_event_close(uv_fs_event_t* handle) { +void uv__fs_event_destroy(uv_fs_event_t* handle) { ev_ref(handle->loop->ev); ev_io_stop(handle->loop->ev, &handle->event_watcher); close(handle->fd); @@ -214,7 +213,7 @@ int uv_fs_event_init(uv_loop_t* loop, } -void uv__fs_event_close(uv_fs_event_t* handle) { +void uv__fs_event_destroy(uv_fs_event_t* handle) { UNREACHABLE(); } @@ -240,24 +239,28 @@ uv_err_t uv_get_process_title(char* buffer, size_t size) { uv_err_t uv_resident_set_memory(size_t* rss) { + pid_t pid = getpid(); psinfo_t psinfo; - uv_err_t err; - int fd; + char pidpath[1024]; + FILE *f; - fd = open("/proc/self/psinfo", O_RDONLY); - if (fd == -1) + sprintf(pidpath, "/proc/%d/psinfo", (int)pid); + + f = fopen(pidpath, "r"); + if (!f) return uv__new_sys_error(errno); + + if (fread(&psinfo, sizeof(psinfo_t), 1, f) != 1) { + fclose (f); return uv__new_sys_error(errno); + } - err = uv_ok_; + /* XXX correct? */ - if (read(fd, &psinfo, sizeof(psinfo)) == sizeof(psinfo)) - *rss = (size_t)psinfo.pr_rssize * 1024; - else - err = uv__new_sys_error(EINVAL); + *rss = (size_t) psinfo.pr_rssize * 1024; - close(fd); + fclose (f); - return err; + return uv_ok_; } |