diff options
| author | Juanma Barranquero | 2006-11-02 09:55:33 +0000 |
|---|---|---|
| committer | Juanma Barranquero | 2006-11-02 09:55:33 +0000 |
| commit | 1e7823d0610945d420922081f678e60e5cf6df2a (patch) | |
| tree | 30b7f28ed3944146dfa212afa77bd5ae156b97da /lib-src | |
| parent | 98644ad4a01f5400f8ae3538aa3debbf69727fbd (diff) | |
| download | emacs-1e7823d0610945d420922081f678e60e5cf6df2a.tar.gz emacs-1e7823d0610945d420922081f678e60e5cf6df2a.zip | |
[WINDOWSNT]: Define HAVE_INET_SOCKETS.
[!WINDOWSNT]: Include <netinet/in.h> if available.
[HAVE_SOCKETS]: Also require HAVE_INET_SOCKETS.
(IOCTL, IOCTL_BOOL_ARG): Remove.
(set_tcp_socket): Don't set the socket in blocking mode. Remove c_arg.
Diffstat (limited to 'lib-src')
| -rw-r--r-- | lib-src/ChangeLog | 9 | ||||
| -rw-r--r-- | lib-src/emacsclient.c | 29 |
2 files changed, 16 insertions, 22 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 2c8ee548bd7..d187697226e 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2006-11-02 Tim Van Holder <tim.vanholder@gmail.com> (tiny change) | ||
| 2 | |||
| 3 | * emacsclient.c [WINDOWSNT]: Define HAVE_INET_SOCKETS. | ||
| 4 | [!WINDOWSNT]: Include <netinet/in.h> if available. | ||
| 5 | [HAVE_SOCKETS]: Also require HAVE_INET_SOCKETS. | ||
| 6 | (IOCTL, IOCTL_BOOL_ARG): Remove. | ||
| 7 | (set_tcp_socket): Don't set the socket in blocking mode. | ||
| 8 | Remove c_arg. | ||
| 9 | |||
| 1 | 2006-11-01 Juanma Barranquero <lekktu@gmail.com> | 10 | 2006-11-01 Juanma Barranquero <lekktu@gmail.com> |
| 2 | 11 | ||
| 3 | * emacsclient.c (fail) [WINDOWSNT]: Force the first argv passed to | 12 | * emacsclient.c (fail) [WINDOWSNT]: Force the first argv passed to |
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c index 28e626f77d0..bede01aaa0b 100644 --- a/lib-src/emacsclient.c +++ b/lib-src/emacsclient.c | |||
| @@ -32,28 +32,23 @@ Boston, MA 02110-1301, USA. */ | |||
| 32 | # include <stdlib.h> | 32 | # include <stdlib.h> |
| 33 | 33 | ||
| 34 | # define HAVE_SOCKETS | 34 | # define HAVE_SOCKETS |
| 35 | # define HAVE_INET_SOCKETS | ||
| 35 | # define NO_SOCKETS_IN_FILE_SYSTEM | 36 | # define NO_SOCKETS_IN_FILE_SYSTEM |
| 36 | 37 | ||
| 37 | # define HSOCKET SOCKET | 38 | # define HSOCKET SOCKET |
| 38 | # define CLOSE_SOCKET closesocket | 39 | # define CLOSE_SOCKET closesocket |
| 39 | # define IOCTL ioctlsocket | ||
| 40 | # define INITIALIZE() (initialize_sockets ()) | 40 | # define INITIALIZE() (initialize_sockets ()) |
| 41 | typedef unsigned long IOCTL_BOOL_ARG; | ||
| 42 | 41 | ||
| 43 | #else /* !WINDOWSNT */ | 42 | #else /* !WINDOWSNT */ |
| 44 | 43 | ||
| 45 | #ifdef HAVE_FCNTL_H | 44 | # ifdef HAVE_INET_SOCKETS |
| 46 | # include <fcntl.h> | 45 | # include <netinet/in.h> |
| 47 | #endif | 46 | # endif |
| 48 | # include <netinet/in.h> | ||
| 49 | # include <sys/ioctl.h> | ||
| 50 | 47 | ||
| 51 | # define INVALID_SOCKET -1 | 48 | # define INVALID_SOCKET -1 |
| 52 | # define HSOCKET int | 49 | # define HSOCKET int |
| 53 | # define CLOSE_SOCKET close | 50 | # define CLOSE_SOCKET close |
| 54 | # define IOCTL ioctl | ||
| 55 | # define INITIALIZE() | 51 | # define INITIALIZE() |
| 56 | typedef int IOCTL_BOOL_ARG; | ||
| 57 | 52 | ||
| 58 | #endif /* !WINDOWSNT */ | 53 | #endif /* !WINDOWSNT */ |
| 59 | 54 | ||
| @@ -271,7 +266,7 @@ fail (argc, argv) | |||
| 271 | } | 266 | } |
| 272 | 267 | ||
| 273 | 268 | ||
| 274 | #if !defined (HAVE_SOCKETS) | 269 | #if !defined (HAVE_SOCKETS) || !defined (HAVE_INET_SOCKETS) |
| 275 | 270 | ||
| 276 | int | 271 | int |
| 277 | main (argc, argv) | 272 | main (argc, argv) |
| @@ -285,7 +280,7 @@ main (argc, argv) | |||
| 285 | fail (argc, argv); | 280 | fail (argc, argv); |
| 286 | } | 281 | } |
| 287 | 282 | ||
| 288 | #else /* HAVE_SOCKETS */ | 283 | #else /* HAVE_SOCKETS && HAVE_INET_SOCKETS */ |
| 289 | 284 | ||
| 290 | #ifdef WINDOWSNT | 285 | #ifdef WINDOWSNT |
| 291 | # include <winsock2.h> | 286 | # include <winsock2.h> |
| @@ -469,7 +464,6 @@ set_tcp_socket () | |||
| 469 | { | 464 | { |
| 470 | HSOCKET s; | 465 | HSOCKET s; |
| 471 | struct sockaddr_in server; | 466 | struct sockaddr_in server; |
| 472 | IOCTL_BOOL_ARG c_arg = 0; | ||
| 473 | struct linger l_arg = {1, 1}; | 467 | struct linger l_arg = {1, 1}; |
| 474 | char auth_string[AUTH_KEY_LENGTH + 1]; | 468 | char auth_string[AUTH_KEY_LENGTH + 1]; |
| 475 | 469 | ||
| @@ -498,15 +492,6 @@ set_tcp_socket () | |||
| 498 | return INVALID_SOCKET; | 492 | return INVALID_SOCKET; |
| 499 | } | 493 | } |
| 500 | 494 | ||
| 501 | #ifdef O_NONBLOCK | ||
| 502 | IOCTL (s, O_NONBLOCK, &c_arg); | ||
| 503 | #else | ||
| 504 | #ifdef O_NDELAY | ||
| 505 | IOCTL (s, O_NDELAY, &c_arg); | ||
| 506 | #else | ||
| 507 | IOCTL (s, FIONBIO, &c_arg); | ||
| 508 | #endif | ||
| 509 | #endif | ||
| 510 | setsockopt (s, SOL_SOCKET, SO_LINGER, (char *) &l_arg, sizeof l_arg); | 495 | setsockopt (s, SOL_SOCKET, SO_LINGER, (char *) &l_arg, sizeof l_arg); |
| 511 | 496 | ||
| 512 | /* | 497 | /* |
| @@ -818,7 +803,7 @@ main (argc, argv) | |||
| 818 | return EXIT_SUCCESS; | 803 | return EXIT_SUCCESS; |
| 819 | } | 804 | } |
| 820 | 805 | ||
| 821 | #endif /* HAVE_SOCKETS */ | 806 | #endif /* HAVE_SOCKETS && HAVE_INET_SOCKETS */ |
| 822 | 807 | ||
| 823 | #ifndef HAVE_STRERROR | 808 | #ifndef HAVE_STRERROR |
| 824 | char * | 809 | char * |