set "terminal" to stdin when doing rrestore
authorKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Sun, 15 May 1983 07:46:08 +0000 (23:46 -0800)
committerKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Sun, 15 May 1983 07:46:08 +0000 (23:46 -0800)
SCCS-vsn: sbin/restore/tape.c 3.16

usr/src/sbin/restore/tape.c

index 8615f6e..3762eb7 100644 (file)
@@ -1,7 +1,7 @@
 /* Copyright (c) 1983 Regents of the University of California */
 
 #ifndef lint
 /* Copyright (c) 1983 Regents of the University of California */
 
 #ifndef lint
-static char sccsid[] = "@(#)tape.c     3.15    (Berkeley)      83/05/06";
+static char sccsid[] = "@(#)tape.c     3.16    (Berkeley)      83/05/14";
 #endif
 
 #include "restore.h"
 #endif
 
 #include "restore.h"
@@ -34,10 +34,10 @@ static int  pathlen;
 setinput(source)
        char *source;
 {
 setinput(source)
        char *source;
 {
-#ifdef RRESTOR
        char *host;
        char *host;
-       char *index();
 
 
+       terminal = stdin;
+#ifdef RRESTOR
        host = source;
        magtape = index(host, ':');
        if (magtape == 0) {
        host = source;
        magtape = index(host, ':');
        if (magtape == 0) {
@@ -50,9 +50,7 @@ nohost:
                done(1);
        setuid(getuid());       /* no longer need or want root privileges */
 #else
                done(1);
        setuid(getuid());       /* no longer need or want root privileges */
 #else
-       if (strcmp(source, "-") != 0) {
-               terminal = stdin;
-       } else {
+       if (strcmp(source, "-") == 0) {
                /*
                 * Since input is coming from a pipe we must establish
                 * our own connection to the terminal.
                /*
                 * Since input is coming from a pipe we must establish
                 * our own connection to the terminal.