Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: joyent/libuv
base: 794d8e09d132
Choose a base ref
...
head repository: joyent/libuv
compare: b3ab332b340f
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on May 1, 2013

  1. unix: fix EMFILE error handling

    On Linux, the accept() and accept4() system calls checks for EMFILE
    before checking for EAGAIN. Refine our EMFILE error handling tactic
    to deal with that. Here is what used to happen:
    
     1. The event loop calls accept() and sees EMFILE.
    
     2. Libuv switches to EMFILE error handling mode. It closes a stashed
        file descriptor and calls accept() again.
    
     3. The accept() system call fails with EAGAIN.
    
     4. Libuv reopens the stashed file descriptor (reaching RLIMIT_NOFILE
        again) and returns control to the regular event loop.
    
     5. The regular event loop calls accept(), sees EMFILE and jumps to
        step 2 again. Effectively an infinite loop.
    
    Avoid that by not calling accept() again when we've seen EAGAIN.
    
    Fixes nodejs/node-v0.x-archive#5389.
    bnoordhuis committed May 1, 2013
    Copy the full SHA
    b3ab332 View commit details
    Browse the repository at this point in the history