summaryrefslogtreecommitdiff
path: root/lib-src/emacsclient.c
diff options
context:
space:
mode:
authorJuanma Barranquero <lekktu@gmail.com>2006-11-02 09:55:33 +0000
committerJuanma Barranquero <lekktu@gmail.com>2006-11-02 09:55:33 +0000
commit1e7823d0610945d420922081f678e60e5cf6df2a (patch)
tree30b7f28ed3944146dfa212afa77bd5ae156b97da /lib-src/emacsclient.c
parent98644ad4a01f5400f8ae3538aa3debbf69727fbd (diff)
[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/emacsclient.c')
-rw-r--r--lib-src/emacsclient.c29
1 files changed, 7 insertions, 22 deletions
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index 28e626f77d..bede01aaa0 100644
--- a/lib-src/emacsclient.c
+++ b/lib-src/emacsclient.c
@@ -32,28 +32,23 @@ Boston, MA 02110-1301, USA. */
# include <stdlib.h>
# define HAVE_SOCKETS
+# define HAVE_INET_SOCKETS
# define NO_SOCKETS_IN_FILE_SYSTEM
# define HSOCKET SOCKET
# define CLOSE_SOCKET closesocket
-# define IOCTL ioctlsocket
# define INITIALIZE() (initialize_sockets ())
-typedef unsigned long IOCTL_BOOL_ARG;
#else /* !WINDOWSNT */
-#ifdef HAVE_FCNTL_H
-# include <fcntl.h>
-#endif
-# include <netinet/in.h>
-# include <sys/ioctl.h>
+# ifdef HAVE_INET_SOCKETS
+# include <netinet/in.h>
+# endif
# define INVALID_SOCKET -1
# define HSOCKET int
# define CLOSE_SOCKET close
-# define IOCTL ioctl
# define INITIALIZE()
-typedef int IOCTL_BOOL_ARG;
#endif /* !WINDOWSNT */
@@ -271,7 +266,7 @@ fail (argc, argv)
}
-#if !defined (HAVE_SOCKETS)
+#if !defined (HAVE_SOCKETS) || !defined (HAVE_INET_SOCKETS)
int
main (argc, argv)
@@ -285,7 +280,7 @@ main (argc, argv)
fail (argc, argv);
}
-#else /* HAVE_SOCKETS */
+#else /* HAVE_SOCKETS && HAVE_INET_SOCKETS */
#ifdef WINDOWSNT
# include <winsock2.h>
@@ -469,7 +464,6 @@ set_tcp_socket ()
{
HSOCKET s;
struct sockaddr_in server;
- IOCTL_BOOL_ARG c_arg = 0;
struct linger l_arg = {1, 1};
char auth_string[AUTH_KEY_LENGTH + 1];
@@ -498,15 +492,6 @@ 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);
/*
@@ -818,7 +803,7 @@ main (argc, argv)
return EXIT_SUCCESS;
}
-#endif /* HAVE_SOCKETS */
+#endif /* HAVE_SOCKETS && HAVE_INET_SOCKETS */
#ifndef HAVE_STRERROR
char *