]> code.delx.au - gnu-emacs/commitdiff
[!WINDOWSNT]: Include <fcntl.h> if available.
authorJuanma Barranquero <lekktu@gmail.com>
Tue, 31 Oct 2006 13:52:32 +0000 (13:52 +0000)
committerJuanma Barranquero <lekktu@gmail.com>
Tue, 31 Oct 2006 13:52:32 +0000 (13:52 +0000)
(set_tcp_socket): Prefer O_NONBLOCK, then O_NDELAY, then FIONBIO to set the
socket in non-blocking mode.

lib-src/ChangeLog
lib-src/emacsclient.c

index b3ac07ec26943afea3716de9a244f63a777e5d09..939cb1b24c011798f91b61393f55a0263a7af1ad 100644 (file)
@@ -1,3 +1,9 @@
+2006-10-31  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
+
+       * emacsclient.c [!WINDOWSNT]: Include <fcntl.h> 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  <tim.vanholder@gmail.com>  (tiny change)
 
        * emacsclient.c [!WINDOWSNT]: Include <netinet/in.h> and <sys/ioctl.h>.
index b3a5180653c51cf7af863b70a75d43980879c285..b7f3dd592a70948aa2ead9f7b7313b6b199839cc 100644 (file)
@@ -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 <fcntl.h>
+#endif
 # include <netinet/in.h>
 # include <sys/ioctl.h>
 # 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);
 
   /*