Commit 293f9f2a authored by Richard M. Stallman's avatar Richard M. Stallman

(main): Restore errno from saved_errno,

so the error message comes from socket_status.
parent 51e473ce
...@@ -388,12 +388,14 @@ main (argc, argv) ...@@ -388,12 +388,14 @@ main (argc, argv)
that init_editfns uses to set the global Vuser_full_name. */ that init_editfns uses to set the global Vuser_full_name. */
char *user_name = (char *) getenv ("LOGNAME"); char *user_name = (char *) getenv ("LOGNAME");
if (!user_name) if (!user_name)
user_name = (char *) getenv ("USER"); user_name = (char *) getenv ("USER");
if (user_name) if (user_name)
{ {
struct passwd *pw = getpwnam (user_name); struct passwd *pw = getpwnam (user_name);
if (pw && (pw->pw_uid != geteuid ())) if (pw && (pw->pw_uid != geteuid ()))
{ {
/* We're running under su, apparently. */ /* We're running under su, apparently. */
...@@ -412,6 +414,8 @@ main (argc, argv) ...@@ -412,6 +414,8 @@ main (argc, argv)
sock_status = socket_status (server.sun_path); sock_status = socket_status (server.sun_path);
saved_errno = errno; saved_errno = errno;
} }
else
errno = saved_errno;
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment