Merged in changes from CVS HEAD
Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-33 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-34 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-35 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-36 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-37 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-38 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-39 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-40 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-41 Make fringe-drawing stuff compile without a window-system * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-42 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-43 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-44 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-45 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-46 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-47 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-48 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-49 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-50 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-59
This commit is contained in:
commit
2a36494c42
57 changed files with 2037 additions and 583 deletions
|
@ -1,5 +1,5 @@
|
|||
/* Client process that communicates with GNU Emacs acting as server.
|
||||
Copyright (C) 1986, 1987, 1994, 1999, 2000, 2001, 2003
|
||||
Copyright (C) 1986, 1987, 1994, 1999, 2000, 2001, 2003, 2004
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Emacs.
|
||||
|
@ -438,9 +438,10 @@ main (argc, argv)
|
|||
|
||||
{
|
||||
int sock_status = 0;
|
||||
int default_sock = !socket_name;
|
||||
int saved_errno = 0;
|
||||
|
||||
if (! socket_name)
|
||||
if (default_sock)
|
||||
{
|
||||
socket_name = alloca (system_name_length + 100);
|
||||
sprintf (socket_name, "/tmp/emacs%d-%s/server",
|
||||
|
@ -459,7 +460,7 @@ main (argc, argv)
|
|||
/* See if the socket exists, and if it's owned by us. */
|
||||
sock_status = socket_status (server.sun_path);
|
||||
saved_errno = errno;
|
||||
if (sock_status)
|
||||
if (sock_status && default_sock)
|
||||
{
|
||||
/* Failing that, see if LOGNAME or USER exist and differ from
|
||||
our euid. If so, look for a socket based on the UID
|
||||
|
@ -476,8 +477,18 @@ main (argc, argv)
|
|||
if (pw && (pw->pw_uid != geteuid ()))
|
||||
{
|
||||
/* We're running under su, apparently. */
|
||||
sprintf (server.sun_path, "/tmp/emacs%d-%s/server",
|
||||
sprintf (socket_name, "/tmp/emacs%d-%s/server",
|
||||
(int) pw->pw_uid, system_name);
|
||||
|
||||
if (strlen (socket_name) < sizeof (server.sun_path))
|
||||
strcpy (server.sun_path, socket_name);
|
||||
else
|
||||
{
|
||||
fprintf (stderr, "%s: socket-name %s too long",
|
||||
argv[0], socket_name);
|
||||
exit (1);
|
||||
}
|
||||
|
||||
sock_status = socket_status (server.sun_path);
|
||||
saved_errno = errno;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue