changeset 53693:04e9ebd16fcd

(main): Restore errno from saved_errno, so the error message comes from socket_status.
author Richard M. Stallman <rms@gnu.org>
date Sat, 24 Jan 2004 21:57:57 +0000
parents 58aa022ecd15
children 4fe016af1b48
files lib-src/emacsclient.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lib-src/emacsclient.c	Sat Jan 24 21:54:06 2004 +0000
+++ b/lib-src/emacsclient.c	Sat Jan 24 21:57:57 2004 +0000
@@ -388,12 +388,14 @@
 	   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 @@
 		sock_status = socket_status (server.sun_path);
 		saved_errno = errno;
 	      }
+	    else
+	      errno = saved_errno;
 	  }
       }