]> Dogcows Code - chaz/tar/commitdiff
*** empty log message ***
authorFrançois Pinard <pinard@iro.umontreal.ca>
Wed, 16 Nov 1994 02:55:25 +0000 (02:55 +0000)
committerFrançois Pinard <pinard@iro.umontreal.ca>
Wed, 16 Nov 1994 02:55:25 +0000 (02:55 +0000)
src/getoldopt.c
src/rtapelib.c

index e7d45234f17608e3199a26cf7cc5a1dbcd9ff870..c7057846f49e5a1091628373fc5cfe48ca0c01e8 100644 (file)
@@ -28,6 +28,8 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include <stdio.h>
 #include "getopt.h"
 #include "tar.h"               /* For msg() declaration if STDC_MSG. */
+#include <sys/types.h>
+#include "port.h"              /* For index() redefinition if USG. */
 
 int
 getoldopt(argc, argv, optstring, long_options, opt_index)
@@ -41,7 +43,6 @@ getoldopt(argc, argv, optstring, long_options, opt_index)
        extern int      optind;         /* Global argv index */
        static char     *key;           /* Points to next keyletter */
        static char     use_getopt;     /* !=0 if argv[1][0] was '-' */
-       extern char     *index();
        char            c;
        char            *place;
 
index a7c2c56bfacf9eb964fbdd7f18c1a44c309f79b1..c062eba2bf477b66b7ecf1541c24a8f0969a4df9 100644 (file)
    Redone as a library that can replace open, read, write, etc., by
    Fred Fish, with some additional work by Arnold Robbins.
    Modified to make all rmtXXX calls into macros for speed by Jay Fenlason.
-   Use -DUSE_REXEC for rexec code, courtesy of Dan Kegel, srs!dan.  */
+   Use -DHAVE_NETDB_H for rexec code, courtesy of Dan Kegel, srs!dan.  */
 
 #include <stdio.h>
 #include <sys/types.h>
 #include <signal.h>
 
-#ifndef NO_MTIO
+#ifdef HAVE_SYS_MTIO_H
 #include <sys/ioctl.h>
 #include <sys/mtio.h>
 #endif
 
-#ifdef USE_REXEC
+#ifdef HAVE_NETDB_H
 #include <netdb.h>
 #endif
 
 extern int errno;
 #endif
 
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef STDC_HEADERS
+#include <string.h>
+#include <stdlib.h>
+#endif
+
 /* Maximum size of a fully qualified host name.  */
 #define MAXHOSTLEN 257
 
@@ -192,7 +200,7 @@ status (fildes)
   return atoi (cp + 1);
 }
 
-#ifdef USE_REXEC
+#ifdef HAVE_NETDB_H
 /* Execute /etc/rmt as user USER on remote system HOST using rexec.
    Return a file descriptor of a bidirectional socket for stdin and stdout.
    If USER is NULL, or an empty string, use the current username.
@@ -240,7 +248,7 @@ _rmt_rexec (host, user)
 
   return tape_fd;
 }
-#endif /* USE_REXEC */
+#endif /* HAVE_NETDB_H */
 
 /* Open a magtape device on the system specified in PATH, as the given user.
    PATH has the form `[user@]system:/dev/????'.
@@ -328,12 +336,12 @@ __rmt_open (path, oflag, mode, bias)
     }
   *dev = '\0';
 
-#ifdef USE_REXEC
+#ifdef HAVE_NETDB_H
   /* Execute the remote command using rexec.  */
   READ (i) = WRITE (i) = _rmt_rexec (system, login);
   if (READ (i) < 0)
     return -1;
-#else /* !USE_REXEC */
+#else /* !HAVE_NETDB_H */
   /* Set up the pipes for the `rsh' command, and fork.  */
 
   if (pipe (to_rmt[i]) == -1 || pipe (from_rmt[i]) == -1)
@@ -395,7 +403,7 @@ __rmt_open (path, oflag, mode, bias)
   /* Parent.  */
   close (to_rmt[i][0]);
   close (from_rmt[i][1]);
-#endif /* !USE_REXEC */
+#endif /* !HAVE_NETDB_H */
 
   /* Attempt to open the tape device.  */
 
@@ -504,7 +512,8 @@ __rmt_lseek (fildes, offset, whence)
 /* Perform a raw tape operation on remote tape connection FILDES.
    Return the results of the ioctl, or -1 on error.  */
 
-#ifndef NO_MTIO
+#ifdef MTIOCTOP
+int
 __rmt_ioctl (fildes, op, arg)
      int fildes, op;
      char *arg;
@@ -566,4 +575,4 @@ __rmt_ioctl (fildes, op, arg)
       return 0;
     }
 }
-#endif /* NO_MTIO */
+#endif
This page took 0.028612 seconds and 4 git commands to generate.