comparison svr-chansession.c @ 480:c302c7383282

- Get rid of some ugly #defines
author Matt Johnston <matt@ucc.asn.au>
date Mon, 15 Sep 2008 13:06:40 +0000
parents f11544d96354
children 357a2e2e9bcc
comparison
equal deleted inserted replaced
479:e3db1f7a2e43 480:c302c7383282
638 int outfds[2]; 638 int outfds[2];
639 int errfds[2]; 639 int errfds[2];
640 pid_t pid; 640 pid_t pid;
641 unsigned int i; 641 unsigned int i;
642 642
643 const int FDIN = 0;
644 const int FDOUT = 1;
645
643 TRACE(("enter noptycommand")) 646 TRACE(("enter noptycommand"))
644 647
645 /* redirect stdin/stdout/stderr */ 648 /* redirect stdin/stdout/stderr */
646 if (pipe(infds) != 0) 649 if (pipe(infds) != 0)
647 return DROPBEAR_FAILURE; 650 return DROPBEAR_FAILURE;
667 if (signal(SIGCHLD, SIG_DFL) == SIG_ERR) { 670 if (signal(SIGCHLD, SIG_DFL) == SIG_ERR) {
668 dropbear_exit("signal() error"); 671 dropbear_exit("signal() error");
669 } 672 }
670 673
671 /* redirect stdin/stdout */ 674 /* redirect stdin/stdout */
672 #define FDIN 0 675
673 #define FDOUT 1
674 if ((dup2(infds[FDIN], STDIN_FILENO) < 0) || 676 if ((dup2(infds[FDIN], STDIN_FILENO) < 0) ||
675 (dup2(outfds[FDOUT], STDOUT_FILENO) < 0) || 677 (dup2(outfds[FDOUT], STDOUT_FILENO) < 0) ||
676 (dup2(errfds[FDOUT], STDERR_FILENO) < 0)) { 678 (dup2(errfds[FDOUT], STDERR_FILENO) < 0)) {
677 TRACE(("leave noptycommand: error redirecting FDs")) 679 TRACE(("leave noptycommand: error redirecting FDs"))
678 return DROPBEAR_FAILURE; 680 return DROPBEAR_FAILURE;