summaryrefslogtreecommitdiff
path: root/session.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2001-10-10 15:02:46 +1000
committerDamien Miller <djm@mindrot.org>2001-10-10 15:02:46 +1000
commit9c751429176f774bc327c23acb0711e76856e209 (patch)
tree3d79ba363c96d8c65a220a7e2a2efd3c5ee5aa4f /session.c
parente398004f6c9aec5d46d0b77950592462f327e28b (diff)
- markus@cvs.openbsd.org 2001/10/06 00:36:42
[session.c] fix typo in error message, sync with do_exec_nopty
Diffstat (limited to 'session.c')
-rw-r--r--session.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/session.c b/session.c
index 482590803..b89143179 100644
--- a/session.c
+++ b/session.c
@@ -33,7 +33,7 @@
33 */ 33 */
34 34
35#include "includes.h" 35#include "includes.h"
36RCSID("$OpenBSD: session.c,v 1.102 2001/09/16 14:46:54 markus Exp $"); 36RCSID("$OpenBSD: session.c,v 1.103 2001/10/06 00:36:42 markus Exp $");
37 37
38#include "ssh.h" 38#include "ssh.h"
39#include "ssh1.h" 39#include "ssh1.h"
@@ -560,17 +560,13 @@ do_exec_pty(Session *s, const char *command)
560 /* Make the pseudo tty our controlling tty. */ 560 /* Make the pseudo tty our controlling tty. */
561 pty_make_controlling_tty(&ttyfd, s->tty); 561 pty_make_controlling_tty(&ttyfd, s->tty);
562 562
563 /* Redirect stdin from the pseudo tty. */ 563 /* Redirect stdin/stdout/stderr from the pseudo tty. */
564 if (dup2(ttyfd, fileno(stdin)) < 0) 564 if (dup2(ttyfd, 0) < 0)
565 error("dup2 stdin failed: %.100s", strerror(errno)); 565 error("dup2 stdin: %s", strerror(errno));
566 566 if (dup2(ttyfd, 1) < 0)
567 /* Redirect stdout to the pseudo tty. */ 567 error("dup2 stdout: %s", strerror(errno));
568 if (dup2(ttyfd, fileno(stdout)) < 0) 568 if (dup2(ttyfd, 2) < 0)
569 error("dup2 stdin failed: %.100s", strerror(errno)); 569 error("dup2 stderr: %s", strerror(errno));
570
571 /* Redirect stderr to the pseudo tty. */
572 if (dup2(ttyfd, fileno(stderr)) < 0)
573 error("dup2 stdin failed: %.100s", strerror(errno));
574 570
575 /* Close the extra descriptor for the pseudo tty. */ 571 /* Close the extra descriptor for the pseudo tty. */
576 close(ttyfd); 572 close(ttyfd);