Mercurial > emacs
diff lib-src/emacsclient.c @ 493:8b101799ff37
*** empty log message ***
author | Jim Blandy <jimb@redhat.com> |
---|---|
date | Tue, 14 Jan 1992 08:05:08 +0000 |
parents | 84799f3f3488 |
children | fc1f790220a4 |
line wrap: on
line diff
--- a/lib-src/emacsclient.c Tue Jan 14 07:40:35 1992 +0000 +++ b/lib-src/emacsclient.c Tue Jan 14 08:05:08 1992 +0000 @@ -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 @@ #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 @@ 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 @@ } 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); + { + 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); - } + 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) {