dup stderr, so get error messages from ls
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Tue, 20 Dec 1988 08:32:11 +0000 (00:32 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Tue, 20 Dec 1988 08:32:11 +0000 (00:32 -0800)
SCCS-vsn: libexec/ftpd/popen.c 5.6

usr/src/libexec/ftpd/popen.c

index 061c950..841dcc6 100644 (file)
@@ -21,7 +21,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)popen.c    5.5 (Berkeley) %G%";
+static char sccsid[] = "@(#)popen.c    5.6 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/types.h>
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -90,6 +90,7 @@ ftpd_popen(program, type)
                if (*type == 'r') {
                        if (pdes[1] != 1) {
                                dup2(pdes[1], 1);
                if (*type == 'r') {
                        if (pdes[1] != 1) {
                                dup2(pdes[1], 1);
+                               dup2(pdes[1], 2);       /* stderr, too! */
                                (void)close(pdes[1]);
                        }
                        (void)close(pdes[0]);
                                (void)close(pdes[1]);
                        }
                        (void)close(pdes[0]);