From efb859b44a15047011d1687933da6a31a43cc30a Mon Sep 17 00:00:00 2001 From: Jim Blandy Date: Tue, 14 Jan 1992 08:05:08 +0000 Subject: *** empty log message *** --- lib-src/emacsclient.c | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) (limited to 'lib-src/emacsclient.c') diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c index 89e90b250ff..bd2edf62993 100644 --- a/lib-src/emacsclient.c +++ b/lib-src/emacsclient.c @@ -1,4 +1,4 @@ -/* Client process that communicates with GNU Emacs acting as server.` +/* Client process that communicates with GNU Emacs acting as server. Copyright (C) 1986, 1987 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -49,13 +49,10 @@ main (argc, argv) #include #include #include +#include #include #include -#ifndef SERVER_HOME_DIR -#include -#endif - extern int sys_nerr; extern char *sys_errlist[]; extern int errno; @@ -70,9 +67,6 @@ main (argc, argv) struct sockaddr_un server; char *homedir, *cwd, *str; char string[BUFSIZ]; -#ifndef SERVER_HOME_DIR - struct stat statbfr; -#endif char *getenv (), *getwd (); int geteuid (); @@ -95,19 +89,23 @@ main (argc, argv) } server.sun_family = AF_UNIX; #ifndef SERVER_HOME_DIR - gethostname (system_name, sizeof (system_name)); - sprintf (server.sun_path, "/tmp/esrv%d-%s", geteuid (), system_name); - - if (stat (server.sun_path, &statbfr) == -1) - { - perror ("stat"); - exit (1); - } - if (statbfr.st_uid != geteuid()) - { - fprintf (stderr, "Illegal socket owner\n"); - exit (1); - } + { + struct stat statbfr; + + gethostname (system_name, sizeof (system_name)); + sprintf (server.sun_path, "/tmp/esrv%d-%s", geteuid (), system_name); + + if (stat (server.sun_path, &statbfr) == -1) + { + perror ("stat"); + exit (1); + } + if (statbfr.st_uid != geteuid()) + { + fprintf (stderr, "Illegal socket owner\n"); + exit (1); + } + } #else if ((homedir = getenv ("HOME")) == NULL) { -- cgit v1.2.1