summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2001-10-06 00:36:43 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2001-10-06 00:36:43 +0000
commit97da9745ca925030efce317a3ee861d9cd578e3d (patch)
tree0667bb93b54c9a90575d473afa4da2fe04c1f156
parenta64d71fef25f1fbae4c57bf8717f889fd9379591 (diff)
fix typo in error message, sync with do_exec_nopty
-rw-r--r--usr.bin/ssh/session.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/usr.bin/ssh/session.c b/usr.bin/ssh/session.c
index 2431470fd4f..f678c1634f3 100644
--- a/usr.bin/ssh/session.c
+++ b/usr.bin/ssh/session.c
@@ -33,7 +33,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: session.c,v 1.102 2001/09/16 14:46:54 markus Exp $");
+RCSID("$OpenBSD: session.c,v 1.103 2001/10/06 00:36:42 markus Exp $");
#include "ssh.h"
#include "ssh1.h"
@@ -503,17 +503,13 @@ do_exec_pty(Session *s, const char *command)
/* Make the pseudo tty our controlling tty. */
pty_make_controlling_tty(&ttyfd, s->tty);
- /* Redirect stdin from the pseudo tty. */
- if (dup2(ttyfd, fileno(stdin)) < 0)
- error("dup2 stdin failed: %.100s", strerror(errno));
-
- /* Redirect stdout to the pseudo tty. */
- if (dup2(ttyfd, fileno(stdout)) < 0)
- error("dup2 stdin failed: %.100s", strerror(errno));
-
- /* Redirect stderr to the pseudo tty. */
- if (dup2(ttyfd, fileno(stderr)) < 0)
- error("dup2 stdin failed: %.100s", strerror(errno));
+ /* Redirect stdin/stdout/stderr from the pseudo tty. */
+ if (dup2(ttyfd, 0) < 0)
+ error("dup2 stdin: %s", strerror(errno));
+ if (dup2(ttyfd, 1) < 0)
+ error("dup2 stdout: %s", strerror(errno));
+ if (dup2(ttyfd, 2) < 0)
+ error("dup2 stderr: %s", strerror(errno));
/* Close the extra descriptor for the pseudo tty. */
close(ttyfd);