summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qarsh.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/qarsh.c b/qarsh.c
index 6d02762..c713380 100644
--- a/qarsh.c
+++ b/qarsh.c
@@ -193,6 +193,7 @@ run_remote_cmd(char *cmdline)
int nbytes;
struct timespec timeout;
short cmd_finished;
+ short stdin_isatty = isatty(fileno(stdin));
qp = make_qp_runcmd(cmdline);
send_packet(qarsh_fd, qp);
@@ -225,7 +226,7 @@ run_remote_cmd(char *cmdline)
/* allowed_in is set to -1 when stdin is closed */
if (allowed_in != -1) {
/* close stdin if it is a tty */
- if (isatty(fileno(stdin))) {
+ if (stdin_isatty) {
qp = make_qp_data(0, 0, 0, NULL);
send_packet(qarsh_fd, qp);
qpfree(qp);