Skip to content
Commits on Jan 11, 2013
  1. @bnoordhuis

    Revert "unix: improve uv_guess_handle() implementation"

    This reverts commit 98bcddc.
    
    It's making a lot of tests in the node.js test suite fail.
    bnoordhuis committed Jan 11, 2013
  2. @bnoordhuis

    unix: set closed fd to -1, avoid double close bugs

    * abort() if close() fails
    * set fd to -1 after close() to prevent double close bugs
    bnoordhuis committed Jan 11, 2013
  3. @bnoordhuis
  4. @bnoordhuis

    unix: don't swap stdin file descriptors

    Bug introduced in 47f496a. It turns out the file descriptors of the
    stdin pipe don't have to be swapped around.
    bnoordhuis committed Jan 11, 2013
Commits on Jan 10, 2013
  1. @waywardmonkeys @bnoordhuis
  2. @bnoordhuis

    unix: omit second fcntl() call if possible

    Omit the fcntl() syscall when the O_NONBLOCK or FD_CLOEXEC is already
    set/clear because it's a no-op in that case.
    bnoordhuis committed Jan 10, 2013
Commits on Jan 9, 2013
  1. @bnoordhuis
Commits on Jan 8, 2013
  1. @tfeb @bnoordhuis
  2. @bennoleslie @bnoordhuis

    unix: improve uv_guess_handle() implementation

    uv_guess_handle is currently squelching both fifo and all
    sockets on to the UV_NAMED_PIPE type. Rather than treating
    all sockets as UV_NAMED_PIPE, use getsockopt() and
    getsockaddr() to determine if the socket is an AF_UNIX
    stream (in which case return UV_NAMED_PIPE), or an AF_INET
    stream (in which case return UV_TCP), or an AF_INET datagram
    socket (in which case return UV_UDP).
    
    Additionally, currently all other file descriptor types are
    squelched to the UV_FILE type. Instead, only file descriptors
    that are marked as regular files are treated as UV_FILE. All
    other types (such as directories, character and block devices)
    are now treated as UV_UNKNOWN_HANDLE.
    bennoleslie committed with bnoordhuis Dec 9, 2012
Commits on Jan 7, 2013
  1. @bnoordhuis

    unix: fix GNU-ism introduced in edd1007

    Don't use features.h, it's only available on GNU/glibc systems.
    bnoordhuis committed Jan 7, 2013
Commits on Jan 6, 2013
  1. @bnoordhuis

    test: fix #if defined checks

    Same as edd1007 but this time for the tests.
    bnoordhuis committed Jan 6, 2013
  2. @bnoordhuis

    test: simplify tcp_ref2b

    Said test doesn't need its own close callback, it can piggyback on the
    common close callback.
    bnoordhuis committed Jan 6, 2013
  3. @bnoordhuis
  4. @bnoordhuis

    test, bench: make functions/variables static

    Make functions and variables that are local to the compilation unit
    static. Remove what turns out to be unused.
    bnoordhuis committed Jan 6, 2013
  5. @bnoordhuis

    test, bench: ANSI-fy function prototypes

    Replace `void f()` with `void f(void)`; the former means "a function
    that takes any number of arguments, including none" while the latter
    is what is actually intended: a function taking no arguments.
    
    The first form also isn't strictly conforming ANSI/ISO C.
    bnoordhuis committed Jan 6, 2013
  6. @bnoordhuis

    linux: fix race in uv_resident_set_memory()

    uv_resident_set_memory() used a global buffer to read data into, which
    is a decidedly unsafe thing to do in a multi-threaded environment.
    bnoordhuis committed Jan 6, 2013
  7. @bnoordhuis
  8. @bnoordhuis

    unix: fix up #if defined checks

    `#if FOO` (where FOO is undefined) is a legal construct in C89 and C99
    but gcc, clang and sparse complain loudly about it at higher warning
    levels.
    
    Squelch those warnings. Makes the code more consistent as well.
    bnoordhuis committed Jan 6, 2013
  9. @bnoordhuis
  10. @bnoordhuis
  11. @bnoordhuis
  12. @bnoordhuis
  13. @bnoordhuis
  14. @bnoordhuis
  15. @bnoordhuis

    test: remove consumer_producer test

    It fails intermittently on Travis for no other reason than that Travis
    is occasionally slow. Reduce the number of false positives, remove the
    test.
    bnoordhuis committed Jan 6, 2013
  16. @bnoordhuis

    unix: update loop->time after poll

    Fixes a bug where timers expire prematurely when the following
    conditions hold:
    
      a) libuv first spends some time blocked in the platform poll function
      b) a callback then calls uv_timer_start()
    
    Cause: uv_timer_start() uses an out-of-date loop->time in its
    'when should the timer callback run?' calculations.
    
    Solution: Update loop->time before invoking any callbacks.
    
    Fixes #678.
    bnoordhuis committed Jan 6, 2013
  17. @bnoordhuis

    unix: use uv__hrtime() internally

    This commit renames the various uv_hrtime() implementations to uv__hrtime().
    
    Libuv uses the high-res timer internally in performance-critical code paths.
    Calling the non-public version avoids going through the PLT when libuv is
    compiled as a shared object.
    
    The exported uv_hrtime() now has a single definition in src/unix/core.c that
    calls uv__hrtime().
    
    A future optimization is to lift the uv__hrtime() declarations into header
    files so they can be inlined at the call sites. Then again, linking with -flto
    should accomplish the same thing.
    bnoordhuis committed Jan 6, 2013
Commits on Jan 4, 2013
  1. @indutny

    stream: fix infinite select() polling on osx

    Interruption FD buffer should be emptied after write, otherwise select()
    loop will poll indefinitely.
    indutny committed Jan 2, 2013
Commits on Jan 2, 2013
  1. @bnoordhuis

    unix: remove stale closing check in uv__write()

    Introduced in 0db3274 but no longer necessary; uv__write() no longer
    runs when the handle has been closed. Write callbacks receive a special
    status code that informs them that the handle has been closed.
    bnoordhuis committed Jan 2, 2013
  2. @bnoordhuis
  3. @bnoordhuis
Commits on Dec 28, 2012
  1. @bnoordhuis
  2. @bnoordhuis

    unix: ensure done_cb gets called after uv_cancel()

    Wake up the event loop with uv_async_send() when a request is cancelled.
    Ensures the done_cb is run on the next tick of the event loop.
    
    Not sending a wakeup signal results in the done_cb not getting called until
    another request completes, which may be a long time coming when it's the only
    request in the queue or when other requests are executing long-running jobs.
    
    Fixes #669.
    bnoordhuis committed Dec 28, 2012
  3. @saghul @bnoordhuis

    unix: reset errno when using sendfile emulation

    A common way to check if a uv_fs_t request failed is to check that
    req->errorno != 0.
    
    With uv_fs_sendfile(), when the sendfile() syscall fails, req->errorno is set
    to (for example) ENOTSOCK, even when the emulation code path succeeds.
    
    Zero errno before the call to uv__fs_sendfile_emul() to prevent that from
    happening.
    saghul committed with bnoordhuis Dec 27, 2012
  4. @bnoordhuis
Something went wrong with that request. Please try again.