summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--smenu.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/smenu.c b/smenu.c
index b4a2ef5..058d321 100644
--- a/smenu.c
+++ b/smenu.c
@@ -8801,15 +8801,17 @@ main(int argc, char * argv[])
/* We've finished reading from stdin */
/* we will now get the inputs from the controlling terminal if any */
/* """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" */
+ errno = 0;
if (freopen("/dev/tty", "r", stdin) == NULL)
- fprintf(stderr, "%s\n", "freopen");
+ fprintf(stderr, "/dev/tty: %s\n", strerror(errno));
old_fd1 = dup(1);
old_stdout = fdopen(old_fd1, "w");
setbuf(old_stdout, NULL);
+ errno = 0;
if (freopen("/dev/tty", "w", stdout) == NULL)
- fprintf(stderr, "%s\n", "freopen");
+ fprintf(stderr, "/dev/tty: %s\n", strerror(errno));
setvbuf(stdout, NULL, _IONBF, 0);