From e35fc9628ced2eafed2073622bbab1eec010d82a Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Tue, 31 Oct 2006 09:08:24 +0000 Subject: [PATCH] Fixes to emacsclient.c for GNU/Linux. [!WINDOWSNT] : Include and . (INVALID_SOCKET): Define. (initialize_sockets): Put #endif at the right place. (set_local_socket): Use progname, not argv[0]. --- lib-src/ChangeLog | 10 ++++++++++ lib-src/emacsclient.c | 7 +++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index d36646065e1..0a6b4b35bee 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,3 +1,12 @@ +2006-10-31 Tim Van Holder (tiny change) + + Fixes to emacsclient.c for GNU/Linux. + * emacsclient.c [!WINDOWSNT] : Include and + . + (INVALID_SOCKET): Define. + (initialize_sockets): Put #endif at the right place. + (set_local_socket): Use progname, not argv[0]. + 2006-10-31 Juanma Barranquero * makefile.w32-in (ALL): Add emacsclient. @@ -32,6 +41,7 @@ set_local_socket. Use set_socket. Get answers from server.el with recv(), not file stream functions. + 2006-10-09 Eli Zaretskii * makefile.w32-in (../src/config.h): Fix error message. diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c index 943053b3c0f..b3a5180653c 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 +# include +# include +# define INVALID_SOCKET -1 # define HSOCKET int # define CLOSE_SOCKET close # define IOCTL ioctl @@ -390,8 +393,8 @@ void initialize_sockets () } atexit (close_winsock); -#endif /* WINDOWSNT */ } +#endif /* WINDOWSNT */ /* * Read the information needed to set up a TCP comm channel with @@ -618,7 +621,7 @@ set_local_socket () we are root. */ if (0 != geteuid ()) { - fprintf (stderr, "%s: Invalid socket owner\n", argv[0]); + fprintf (stderr, "%s: Invalid socket owner\n", progname); return INVALID_SOCKET; } break; -- 2.39.5