summaryrefslogtreecommitdiffstats
path: root/login-utils/su.c
diff options
context:
space:
mode:
authorJim Meyering2003-07-18 10:38:43 +0200
committerJim Meyering2003-07-18 10:38:43 +0200
commitf7a168d629faf801308792129d9f0bcf78066117 (patch)
treeb94e69a234d3bccfe0c4810c7b4300df1dd3fdd8 /login-utils/su.c
parent(main): Call initialize_main. (diff)
downloadkernel-qcow2-util-linux-f7a168d629faf801308792129d9f0bcf78066117.tar.gz
kernel-qcow2-util-linux-f7a168d629faf801308792129d9f0bcf78066117.tar.xz
kernel-qcow2-util-linux-f7a168d629faf801308792129d9f0bcf78066117.zip
(usage): Don't call close_stdout here.
(main): Use close_stdout via atexit. Now `su --version > /dev/full' fails, as it should. Somehow, the change of 2000-05-07 that purports to fix this was not checked in.
Diffstat (limited to 'login-utils/su.c')
-rw-r--r--login-utils/su.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/login-utils/su.c b/login-utils/su.c
index 03dc7d8d5..232103921 100644
--- a/login-utils/su.c
+++ b/login-utils/su.c
@@ -452,7 +452,6 @@ Change the effective user id and group id to that of USER.\n\
A mere - implies -l. If USER not given, assume root.\n\
"), stdout);
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
- close_stdout ();
}
exit (status);
}
@@ -474,6 +473,8 @@ main (int argc, char **argv)
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
+ atexit (close_stdout);
+
fast_startup = 0;
simulate_login = 0;
change_environment = 1;