From: Juanma Barranquero Date: Tue, 31 Oct 2006 13:52:32 +0000 (+0000) Subject: [!WINDOWSNT]: Include if available. X-Git-Tag: emacs-pretest-22.0.91~432 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=95d0feaa4a914e897f202c5c0b1d8ea14524620a;p=emacs.git [!WINDOWSNT]: Include if available. (set_tcp_socket): Prefer O_NONBLOCK, then O_NDELAY, then FIONBIO to set the socket in non-blocking mode. --- diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index b3ac07ec269..939cb1b24c0 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,3 +1,9 @@ +2006-10-31 Jan Dj,Ad(Brv + + * emacsclient.c [!WINDOWSNT]: Include if available. + (set_tcp_socket): Prefer O_NONBLOCK, then O_NDELAY, then FIONBIO + to set the socket in non-blocking mode. + 2006-10-31 Tim Van Holder (tiny change) * emacsclient.c [!WINDOWSNT]: Include and . diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c index b3a5180653c..b7f3dd592a7 100644 --- a/lib-src/emacsclient.c +++ b/lib-src/emacsclient.c @@ -38,6 +38,9 @@ Boston, MA 02110-1301, USA. */ # 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 @@ set_tcp_socket () 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); /*