# HG changeset patch # User Juanma Barranquero # Date 1162302635 0 # Node ID 75bfdccded7873b6b1af87bb178003db596d823a # Parent b10ad78a3492c740ae97abf137569215cb1a4823 [!WINDOWSNT]: Include if available. (set_tcp_socket): Prefer O_NONBLOCK, then O_NDELAY, then FIONBIO to set the socket in non-blocking mode. diff -r b10ad78a3492 -r 75bfdccded78 lib-src/emacsclient.c --- a/lib-src/emacsclient.c Tue Oct 31 11:07:10 2006 +0000 +++ b/lib-src/emacsclient.c Tue Oct 31 13:50:35 2006 +0000 @@ -38,6 +38,9 @@ # define INITIALIZE() (initialize_sockets ()) typedef unsigned long IOCTL_BOOL_ARG; #else +#ifdef HAVE_FCNTL_H +# include +#endif # include # include # define INVALID_SOCKET -1 @@ -486,7 +489,15 @@ return INVALID_SOCKET; } +#ifdef O_NONBLOCK + IOCTL (s, O_NONBLOCK, &c_arg); +#else +#ifdef O_NDELAY + IOCTL (s, O_NDELAY, &c_arg); +#else IOCTL (s, FIONBIO, &c_arg); +#endif +#endif setsockopt (s, SOL_SOCKET, SO_LINGER, (char *) &l_arg, sizeof l_arg); /*