From eecb74cb33bb5889b01228c42f734572b7d26094 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fran=C3=A7ois=20Pinard?= Date: Wed, 16 Nov 1994 02:55:25 +0000 Subject: [PATCH] *** empty log message *** --- src/getoldopt.c | 3 ++- src/rtapelib.c | 29 +++++++++++++++++++---------- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/src/getoldopt.c b/src/getoldopt.c index e7d4523..c705784 100644 --- a/src/getoldopt.c +++ b/src/getoldopt.c @@ -28,6 +28,8 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include "getopt.h" #include "tar.h" /* For msg() declaration if STDC_MSG. */ +#include +#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; diff --git a/src/rtapelib.c b/src/rtapelib.c index a7c2c56..c062eba 100644 --- a/src/rtapelib.c +++ b/src/rtapelib.c @@ -29,18 +29,18 @@ 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 #include #include -#ifndef NO_MTIO +#ifdef HAVE_SYS_MTIO_H #include #include #endif -#ifdef USE_REXEC +#ifdef HAVE_NETDB_H #include #endif @@ -52,6 +52,14 @@ extern int errno; #endif +#ifdef HAVE_UNISTD_H +#include +#endif +#ifdef STDC_HEADERS +#include +#include +#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 -- 2.44.0