Commit Graph

140 Commits

Author SHA1 Message Date
Bert Belder
4c63f554a6 Windows: much better pipe_pound_1000 results 2011-08-12 02:44:02 +02:00
Bert Belder
89aa4078cc Windows: try to avoid using the thread pool for pipe shutdown 2011-08-12 02:44:01 +02:00
Bert Belder
a2ee4854c6 Windows: dynamically load some ntdll functions 2011-08-12 02:44:00 +02:00
Bert Belder
2d40e35b7e Style 2011-08-12 02:43:59 +02:00
Ryan Dahl
b44f9d75ea unix: cloexec stdio streams 2011-08-11 16:35:56 -07:00
Ryan Dahl
f7b4e65090 unix: introduce SPAWN_WAIT_EXEC to turn off poll feature 2011-08-11 15:52:22 -07:00
Ryan Dahl
11aa1ea096 Remove unnecessary casts 2011-08-11 11:27:35 -07:00
Bert Belder
ca633920f5 Windows: fix pipe shutdown 2011-08-11 04:18:29 +02:00
Bert Belder
a89410456c Whitespace 2011-08-11 04:18:28 +02:00
Ben Noordhuis
e8497aee5a Add error code UV_EPIPE. 2011-08-11 02:45:27 +02:00
Ben Noordhuis
b328e4cb05 uv-unix: fd 0 is valid file descriptor
uv__bind() and uv_tcp_listen() created a new socket
if tcp->fd <= 0 but 0 is a valid file descriptor.

The second bug was that the newly created socket
wasn't actually assigned to tcp->fd.

Fixes failing node.js test:
  test/simple/test-regress-GH-746.js
2011-08-11 01:36:20 +02:00
Ryan Dahl
ee2027dd13 fix preprocessor again 2011-08-10 16:16:47 -07:00
Ben Noordhuis
b6b97f305e uv-unix: guard against self-close by connection_cb
connection_cb may close the server socket inside the accept loop, handle it.

Fixes failing node.js tests:
  test/simple/test-net-connect-buffer.js
  test/simple/test-net-create-connection.js
2011-08-11 00:33:09 +02:00
Ben Noordhuis
afb1859600 uv-unix: remove dead code 2011-08-11 00:33:09 +02:00
Ryan Dahl
06623d15f2 More preprocessor fixes... 2011-08-10 15:01:38 -07:00
Ryan Dahl
dac30a15f2 More preprocessor fixes 2011-08-10 14:56:16 -07:00
Ryan Dahl
5dc8037fcf Fix mingw build by using preprocessor correctly. 2011-08-10 14:40:52 -07:00
Ryan Dahl
db190c7b4f unix: uv_pipe_connect should call uv__stream_open 2011-08-10 14:22:10 -07:00
Ryan Dahl
b8fe56d837 Remove unnecessary casts 2011-08-10 14:22:10 -07:00
Robert Mustacchi
4b1b8faea8 Clean up SunOS build 2011-08-09 23:51:50 +02:00
Peter Bright
3409c9b383 Include important Windows environmental variables even when a blank/custom environment is specified. 2011-08-09 14:29:51 -07:00
Ben Noordhuis
4abd1e0ccc uv-unix: close file descriptors immediately in uv_close()
Don't defer closing of socket and pipe file descriptors to the
next iteration of the event loop. It breaks node.js unit tests
that assume the call to `server.close()` immediately frees up
the bound to address.
2011-08-09 23:14:38 +02:00
Ben Noordhuis
0c815cfe89 eio: define HAVE_UTIMES 1 on cygwin, fixes build 2011-08-09 22:58:21 +02:00
Ryan Dahl
0266c0ec57 Change for MinGW on Win 2k3 2011-08-09 12:24:01 -07:00
Bert Belder
831b15a47c Windows: fix WaitNamedPipe thread bug 2011-08-09 17:35:18 +02:00
Peter Bright
648baa3826 Fix missing prototype warnings. 2011-08-08 18:11:01 -07:00
Ryan Dahl
1493dcf359 Peter Bright's MSVS fixes 2011-08-06 22:36:59 -07:00
Andrea Lattuada
6c3205557b Remove uv_flag_* functions in favor of manual bit twiddling
Fixes #121
Fixes #129
2011-08-06 12:12:25 -07:00
Ben Noordhuis
62d1c5751e uv-unix: fix warning: passing argument 1 of ‘eio_custom’ from incompatible pointer type 2011-08-06 17:01:09 +02:00
Ben Noordhuis
8abce89e57 build: fix libeio build on linux
Define HAVE_UTIMES so libeio includes <utime.h>
2011-08-06 14:43:50 +02:00
Ryan Dahl
52e1a9e997 Upgrade eio (it has better msvs support) 2011-08-06 00:29:39 -07:00
Igor Zinkovsky
cc143317b1 windows: fix req refcount for uv_pipe_connect 2011-08-05 17:47:20 -07:00
Ryan Dahl
4ca89308b6 Remove assert that is broken on darwin 2011-08-05 17:47:18 -07:00
Tom Hughes
76338f794e ares_parse_a_reply: fix memleak 2011-08-06 00:18:59 +02:00
Ryan Dahl
787ef5da80 uv-unix: Fix missing symbols on FreeBSD7 systems.
thanks Lenny
2011-08-05 11:58:11 -07:00
Ben Noordhuis
2fbcbe90c8 uv-unix: fix build on systems that don't have pipe2() 2011-08-05 17:12:02 +02:00
Bert Belder
c834d5de9e Windows: correct comment in process.c 2011-08-05 08:22:01 +02:00
Ben Noordhuis
041d60e141 uv-unix: avoid exec-after-fork race in uv_spawn()
The race condition in a nutshell:

    if ((pid = fork()) > 0) {
      kill(pid, SIGTERM);
    }
    else if (pid == 0) {
      execve("/bin/cat", argp, envp);
    }

The parent sends a signal immediately after forking.
Since the child may not have called `execve()` yet,
there is no telling what process receives the signal,
our fork or /bin/cat.

To avoid ambiguity, we create a pipe with both ends
marked close-on-exec. Then, after the call to `fork()`,
the parent polls the read end until it sees POLLHUP.
2011-08-05 04:09:20 +02:00
Peter Bright
d84b249616 Support for unescaped arguments, suitable for use with cmd /c.
Robust argument escaping that hopefully matches Windows' algorithm for unescaping.
2011-08-04 18:22:47 -07:00
Ben Noordhuis
c01d6f928c ev: fix infinite loop in ev_walk() 2011-08-04 19:03:47 +02:00
Bert Belder
642d97ced8 Windows: make process arguments buffer computation better 2011-08-03 02:09:37 +02:00
Bert Belder
ec143961d1 Windows: fix bug in process arguments buffer size computation 2011-08-03 01:42:32 +02:00
Bert Belder
dbaddc4423 Windows: avoid errorneous freeing of pipe handle 2011-08-03 00:18:12 +02:00
Ryan Dahl
b2ed24d86e unix: Remove flock code
solaris doesn't have flock
2011-08-02 07:08:13 +00:00
Ryan Dahl
22ec2db413 solaris fixes 2011-08-02 06:29:25 +00:00
Bert Belder
2e9a743da0 Windows: report uv_spawn() failure asynchronously 2011-08-01 20:24:54 -07:00
Igor Zinkovsky
6d940a3afc windows: remove dependency on rpcrt4 and ole32 libs. fixes https://github.com/joyent/libuv/issues/118 2011-08-01 20:10:55 -07:00
Igor Zinkovsky
0d29ea68c9 windows: fix for space in args 2011-08-01 16:41:08 -07:00
Ben Noordhuis
404d697dc4 uv-unix: undo accidental revert of b700896 in 5ec2575 2011-08-02 01:12:57 +02:00
Igor Zinkovsky
5af7423f90 always use PATH from parent 2011-08-01 14:28:39 -07:00