diff options
| author | mikel <mikel@NetBSD.org> | 1997-06-20 04:24:23 +0000 |
|---|---|---|
| committer | mikel <mikel@NetBSD.org> | 1997-06-20 04:24:23 +0000 |
| commit | e6077a76899e0a36806e659692506de60c61fc8f (patch) | |
| tree | 7a3c1a13fa0be7a994ca3edf5fcc5960fe3946ac /lib/librmt | |
| parent | b92f5604b7069c5ff22e26ef831e4e8d2316c6bb (diff) | |
gcc -Wall fixes, including: end unterminated comment (!), add braces
to Ctp and Ptc array initializers, fix sprintf() format in
_rmt_lseek(), add explicit return type for _rmt_ioctl(), and move
isrmt() definition so that it's defined before it's used.
Diffstat (limited to 'lib/librmt')
| -rw-r--r-- | lib/librmt/rmtlib.c | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/lib/librmt/rmtlib.c b/lib/librmt/rmtlib.c index 7b0b0227a3c..dc30493c024 100644 --- a/lib/librmt/rmtlib.c +++ b/lib/librmt/rmtlib.c @@ -1,4 +1,4 @@ -/* $NetBSD: rmtlib.c,v 1.5 1997/01/23 14:03:05 mrg Exp $ */ +/* $NetBSD: rmtlib.c,v 1.6 1997/06/20 04:24:23 mikel Exp $ */ /* * rmt --- remote tape emulator subroutines @@ -28,7 +28,7 @@ */ #define RMTIOCTL 1 -/* #define USE_REXEC 1 /* rexec code courtesy of Dan Kegel, srs!dan */ +/* #define USE_REXEC 1 */ /* rexec code courtesy of Dan Kegel, srs!dan */ #include <stdio.h> #include <stdlib.h> @@ -57,8 +57,8 @@ #define READ(fd) (Ctp[fd][0]) #define WRITE(fd) (Ptc[fd][1]) -static int Ctp[MAXUNIT][2] = { -1, -1, -1, -1, -1, -1, -1, -1 }; -static int Ptc[MAXUNIT][2] = { -1, -1, -1, -1, -1, -1, -1, -1 }; +static int Ctp[MAXUNIT][2] = { {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1} }; +static int Ptc[MAXUNIT][2] = { {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1} }; /* @@ -465,7 +465,7 @@ int whence; { char buffer[BUFMAGIC]; - (void)snprintf(buffer, sizeof buffer, "L%d\n%d\n", offset, whence); + (void)snprintf(buffer, sizeof buffer, "L%ld\n%d\n", offset, whence); if (command(fildes, buffer) == -1) return(-1); @@ -478,7 +478,7 @@ int whence; */ #ifdef RMTIOCTL -static _rmt_ioctl(fildes, op, arg) +static int _rmt_ioctl(fildes, op, arg) int fildes; unsigned long op; char *arg; @@ -656,6 +656,17 @@ int amode; /* + * Isrmt. Let a programmer know he has a remote device. + */ + +int isrmt (fd) +int fd; +{ + return (fd >= REM_BIAS); +} + + +/* * Read from stream. Looks just like read(2) to caller. */ @@ -835,16 +846,6 @@ int mode; } /* - * Isrmt. Let a programmer know he has a remote device. - */ - -int isrmt (fd) -int fd; -{ - return (fd >= REM_BIAS); -} - -/* * Rmtfcntl. Do a remote fcntl operation. */ |
