close-on-exec

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23466 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2008-07-27 12:16:15 +00:00
parent 257fd5237c
commit 57666b9434

View File

@@ -84,7 +84,9 @@ read_string(const char *preprompt, const char *prompt,
if (sigaction(i, &sa, &sigs[i]) == 0)
oksigs[i] = 1;
if((tty = fopen("/dev/tty", "r")) == NULL)
if((tty = fopen("/dev/tty", "r")) != NULL)
rk_cloexec_file(tty);
else
tty = stdin;
fprintf(stderr, "%s%s", preprompt, prompt);