diff options
author | Richard M. Stallman <rms@gnu.org> | 2004-01-24 21:57:57 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 2004-01-24 21:57:57 +0000 |
commit | 293f9f2a993099a5661e3f56ddbd55561d41454a (patch) | |
tree | b9057de7b9ba2c6df71094631932a6fead49d108 /lib-src | |
parent | 51e473ceb042589e4609586b65413b34ad303580 (diff) | |
download | emacs-293f9f2a993099a5661e3f56ddbd55561d41454a.tar.gz |
(main): Restore errno from saved_errno,
so the error message comes from socket_status.
Diffstat (limited to 'lib-src')
-rw-r--r-- | lib-src/emacsclient.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c index 49ebada768f..3ae33f72a18 100644 --- a/lib-src/emacsclient.c +++ b/lib-src/emacsclient.c @@ -388,12 +388,14 @@ main (argc, argv) that init_editfns uses to set the global Vuser_full_name. */ char *user_name = (char *) getenv ("LOGNAME"); + if (!user_name) user_name = (char *) getenv ("USER"); if (user_name) { struct passwd *pw = getpwnam (user_name); + if (pw && (pw->pw_uid != geteuid ())) { /* We're running under su, apparently. */ @@ -412,6 +414,8 @@ main (argc, argv) sock_status = socket_status (server.sun_path); saved_errno = errno; } + else + errno = saved_errno; } } |