diff options
author | Jim Blandy <jimb@redhat.com> | 1992-01-14 08:05:08 +0000 |
---|---|---|
committer | Jim Blandy <jimb@redhat.com> | 1992-01-14 08:05:08 +0000 |
commit | efb859b44a15047011d1687933da6a31a43cc30a (patch) | |
tree | 5495cd790f55c8b9dbde4190c959d026e9157f15 /lib-src/emacsclient.c | |
parent | 2798dedf7cb4bbeba6091c443dc64edf0953da18 (diff) | |
download | emacs-efb859b44a15047011d1687933da6a31a43cc30a.tar.gz |
*** empty log message ***
Diffstat (limited to 'lib-src/emacsclient.c')
-rw-r--r-- | lib-src/emacsclient.c | 40 |
1 files changed, 19 insertions, 21 deletions
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 <sys/types.h> #include <sys/socket.h> #include <sys/un.h> +#include <sys/stat.h> #include <stdio.h> #include <errno.h> -#ifndef SERVER_HOME_DIR -#include <sys/stat.h> -#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) { |