diff options
| author | Juanma Barranquero | 2006-10-31 13:52:32 +0000 |
|---|---|---|
| committer | Juanma Barranquero | 2006-10-31 13:52:32 +0000 |
| commit | 95d0feaa4a914e897f202c5c0b1d8ea14524620a (patch) | |
| tree | bcdd6ed68f6c5daed71bdd3fccf3917d828e113f /lib-src | |
| parent | d4fa60c883cfddb62f64c59062f18c784fcbe67e (diff) | |
| download | emacs-95d0feaa4a914e897f202c5c0b1d8ea14524620a.tar.gz emacs-95d0feaa4a914e897f202c5c0b1d8ea14524620a.zip | |
[!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.
Diffstat (limited to 'lib-src')
| -rw-r--r-- | lib-src/ChangeLog | 6 | ||||
| -rw-r--r-- | lib-src/emacsclient.c | 11 |
2 files changed, 17 insertions, 0 deletions
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 @@ | |||
| 1 | 2006-10-31 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 2 | |||
| 3 | * emacsclient.c [!WINDOWSNT]: Include <fcntl.h> if available. | ||
| 4 | (set_tcp_socket): Prefer O_NONBLOCK, then O_NDELAY, then FIONBIO | ||
| 5 | to set the socket in non-blocking mode. | ||
| 6 | |||
| 1 | 2006-10-31 Tim Van Holder <tim.vanholder@gmail.com> (tiny change) | 7 | 2006-10-31 Tim Van Holder <tim.vanholder@gmail.com> (tiny change) |
| 2 | 8 | ||
| 3 | * emacsclient.c [!WINDOWSNT]: Include <netinet/in.h> and <sys/ioctl.h>. | 9 | * emacsclient.c [!WINDOWSNT]: Include <netinet/in.h> and <sys/ioctl.h>. |
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. */ | |||
| 38 | # define INITIALIZE() (initialize_sockets ()) | 38 | # define INITIALIZE() (initialize_sockets ()) |
| 39 | typedef unsigned long IOCTL_BOOL_ARG; | 39 | typedef unsigned long IOCTL_BOOL_ARG; |
| 40 | #else | 40 | #else |
| 41 | #ifdef HAVE_FCNTL_H | ||
| 42 | # include <fcntl.h> | ||
| 43 | #endif | ||
| 41 | # include <netinet/in.h> | 44 | # include <netinet/in.h> |
| 42 | # include <sys/ioctl.h> | 45 | # include <sys/ioctl.h> |
| 43 | # define INVALID_SOCKET -1 | 46 | # define INVALID_SOCKET -1 |
| @@ -486,7 +489,15 @@ set_tcp_socket () | |||
| 486 | return INVALID_SOCKET; | 489 | return INVALID_SOCKET; |
| 487 | } | 490 | } |
| 488 | 491 | ||
| 492 | #ifdef O_NONBLOCK | ||
| 493 | IOCTL (s, O_NONBLOCK, &c_arg); | ||
| 494 | #else | ||
| 495 | #ifdef O_NDELAY | ||
| 496 | IOCTL (s, O_NDELAY, &c_arg); | ||
| 497 | #else | ||
| 489 | IOCTL (s, FIONBIO, &c_arg); | 498 | IOCTL (s, FIONBIO, &c_arg); |
| 499 | #endif | ||
| 500 | #endif | ||
| 490 | setsockopt (s, SOL_SOCKET, SO_LINGER, (char *) &l_arg, sizeof l_arg); | 501 | setsockopt (s, SOL_SOCKET, SO_LINGER, (char *) &l_arg, sizeof l_arg); |
| 491 | 502 | ||
| 492 | /* | 503 | /* |