Commits on Jan 16, 2013
  1. unix, windows: rename uv_run2 to uv_run

    bnoordhuis committed Jan 16, 2013
    This changes the prototype of uv_run() from:
      int uv_run(uv_loop_t* loop);
      int uv_run(uv_loop_t* loop, uv_run_mode mode);
    Fixes #683.
Commits on Jan 15, 2013
  1. test: remove bad tcp_write_error test

    bnoordhuis committed Jan 15, 2013
    It makes the assumption that if you try to write to a localhost socket
    often enough, eventually its send queue will fill up - which doesn't
    happen if the machine it's running on is fast enough.
Commits on Jan 14, 2013
Commits on Jan 12, 2013
  1. linux: only pack struct uv__epoll_event on x86_64

    bnoordhuis committed Jan 12, 2013
    On i386, it does not need packing; it's 12 bytes packed or unpacked.
    On ARM, it's actively harmful: the struct is 12 bytes when packed and
    16 bytes when unpacked.
  2. build: fix host/target arch detection

    bnoordhuis committed Jan 12, 2013
    Setting the target_arch without setting the host_arch as well was
    effectively broken.
Commits on Jan 11, 2013
  1. Revert "unix: improve uv_guess_handle() implementation"

    bnoordhuis committed Jan 11, 2013
    This reverts commit 98bcddc.
    It's making a lot of tests in the node.js test suite fail.
  2. unix: set closed fd to -1, avoid double close bugs

    bnoordhuis committed Jan 11, 2013
    * abort() if close() fails
    * set fd to -1 after close() to prevent double close bugs
  3. unix: don't swap stdin file descriptors

    bnoordhuis committed Jan 11, 2013
    Bug introduced in 47f496a. It turns out the file descriptors of the
    stdin pipe don't have to be swapped around.
Commits on Jan 10, 2013
  1. unix: omit second fcntl() call if possible

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

    bennoleslie committed with bnoordhuis Dec 9, 2012
    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.
Commits on Jan 7, 2013
  1. unix: fix GNU-ism introduced in edd1007

    bnoordhuis committed Jan 7, 2013
    Don't use features.h, it's only available on GNU/glibc systems.
Commits on Jan 6, 2013
  1. test: fix #if defined checks

    bnoordhuis committed Jan 6, 2013
    Same as edd1007 but this time for the tests.
  2. test: simplify tcp_ref2b

    bnoordhuis committed Jan 6, 2013
    Said test doesn't need its own close callback, it can piggyback on the
    common close callback.
  3. test, bench: make functions/variables static

    bnoordhuis committed Jan 6, 2013
    Make functions and variables that are local to the compilation unit
    static. Remove what turns out to be unused.
  4. test, bench: ANSI-fy function prototypes

    bnoordhuis committed Jan 6, 2013
    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.
  5. linux: fix race in uv_resident_set_memory()

    bnoordhuis committed Jan 6, 2013
    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.
  6. unix: fix up #if defined checks

    bnoordhuis committed Jan 6, 2013
    `#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
    Squelch those warnings. Makes the code more consistent as well.
  7. test: remove consumer_producer test

    bnoordhuis committed Jan 6, 2013
    It fails intermittently on Travis for no other reason than that Travis
    is occasionally slow. Reduce the number of false positives, remove the
  8. unix: update loop->time after poll

    bnoordhuis committed Jan 6, 2013
    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.
  9. unix: use uv__hrtime() internally

    bnoordhuis committed Jan 6, 2013
    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.
Commits on Jan 4, 2013
  1. stream: fix infinite select() polling on osx

    indutny committed Jan 2, 2013
    Interruption FD buffer should be emptied after write, otherwise select()
    loop will poll indefinitely.
Commits on Jan 2, 2013
  1. unix: remove stale closing check in uv__write()

    bnoordhuis committed Jan 2, 2013
    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.