update dup() to dup2()
authorKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Wed, 20 Mar 1985 10:46:40 +0000 (02:46 -0800)
committerKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Wed, 20 Mar 1985 10:46:40 +0000 (02:46 -0800)
SCCS-vsn: old/sh/io.c 4.3
SCCS-vsn: old/sh/main.c 4.3

usr/src/old/sh/io.c
usr/src/old/sh/main.c

index fd14d7b..7586de6 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)io.c       4.2 %G%";
+static char sccsid[] = "@(#)io.c       4.3 %G%";
 #endif
 
 #
 #endif
 
 #
@@ -12,7 +12,6 @@ static char sccsid[] = "@(#)io.c      4.2 %G%";
  */
 
 #include       "defs.h"
  */
 
 #include       "defs.h"
-#include       "dup.h"
 
 
 /* ========    input output and file copying ======== */
 
 
 /* ========    input output and file copying ======== */
@@ -83,7 +82,7 @@ rename(f1,f2)
        REG INT         f1, f2;
 {
        IF f1!=f2
        REG INT         f1, f2;
 {
        IF f1!=f2
-       THEN    dup(f1|DUPFLG, f2);
+       THEN    dup2(f1, f2);
                close(f1);
                IF f2==0 THEN ioset|=1 FI
        FI
                close(f1);
                IF f2==0 THEN ioset|=1 FI
        FI
index a70227a..579eee1 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)main.c     4.2 %G%";
+static char sccsid[] = "@(#)main.c     4.3 %G%";
 #endif
 
 #
 #endif
 
 #
@@ -12,12 +12,12 @@ static char sccsid[] = "@(#)main.c  4.2 %G%";
  */
 
 #include       "defs.h"
  */
 
 #include       "defs.h"
-#include       "dup.h"
 #include       "sym.h"
 #include       "timeout.h"
 #include       <sys/types.h>
 #include       <sys/stat.h>
 #include       <sgtty.h>
 #include       "sym.h"
 #include       "timeout.h"
 #include       <sys/types.h>
 #include       <sys/stat.h>
 #include       <sgtty.h>
+#include       <signal.h>
 
 UFD            output = 2;
 LOCAL BOOL     beenhere = FALSE;
 
 UFD            output = 2;
 LOCAL BOOL     beenhere = FALSE;
@@ -45,7 +45,7 @@ main(c, v)
        addblok((POS)0);
 
        /* set names from userenv */
        addblok((POS)0);
 
        /* set names from userenv */
-       getenv();
+       setupenv();
 
        /* look for restricted */
 /*     IF c>0 ANDF any('r', *v) THEN rflag=0 FI */
 
        /* look for restricted */
 /*     IF c>0 ANDF any('r', *v) THEN rflag=0 FI */
@@ -183,7 +183,7 @@ settmp()
 Ldup(fa, fb)
        REG INT         fa, fb;
 {
 Ldup(fa, fb)
        REG INT         fa, fb;
 {
-       dup(fa|DUPFLG, fb);
+       dup2(fa, fb);
        close(fa);
        ioctl(fb, FIOCLEX, 0);
 }
        close(fa);
        ioctl(fb, FIOCLEX, 0);
 }