libuv/src
Ben Noordhuis 885b1ecda0 darwin: fix uv_exepath(smallbuf) UV_EPERM error
Passing a buffer that was too small to hold the result made it fail
with UV_EPERM because the -1 status code from _NSGetExecutablePath()
was returned unmodified to the caller.

This commit rewrites uv_exepath() to:

1. Not allocate heap memory, and

2. Not clobber the result buffer on error, and

3. Handle _NSGetExecutablePath()'s and realpath()'s idiosyncracies, and

4. Store as much of the path in the output buffer as possible, don't
   fail with an error.  Makes it behave the same as other platforms.
   The result is always zero-terminated.

Fixes: https://github.com/libuv/libuv/issues/103
PR-URL: https://github.com/libuv/libuv/pull/104
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-01-03 23:40:24 +01:00
..
unix darwin: fix uv_exepath(smallbuf) UV_EPERM error 2015-01-03 23:40:24 +01:00
win win/thread: store thread handle in a TLS slot 2015-01-02 16:17:16 +01:00
fs-poll.c unix: replace some asserts with returning errors 2014-08-11 18:42:48 +02:00
heap-inl.h heap: fix heap_remove() 2014-05-23 20:04:42 +04:00
inet.c unix, windows: fix parsing scoped IPv6 addresses 2014-05-25 23:30:46 +02:00
queue.h queue: strengthen type checks 2013-11-02 13:55:57 +01:00
threadpool.c windows: don't use atexit for cleaning up the threadpool 2014-07-28 09:38:57 +02:00
uv-common.c Merge branch 'v0.10' into v1.x 2014-12-05 19:18:36 +01:00
uv-common.h common: move STATIC_ASSERT to uv-common.h 2015-01-02 16:17:10 +01:00
version.c Now working on v0.10.31 2014-12-09 19:49:50 +01:00