X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Frmt.h;h=b85104596138f92f1da2bacf648433b43fa9d2b2;hb=7154feb583181bba66f168bd1006bf812bd12b45;hp=da8f62963983dff62313b5b14dd0ebc0fcb6698a;hpb=edf0754a959ba6230a2ce0a3d2cd41f2c6caa5f4;p=chaz%2Ftar diff --git a/src/rmt.h b/src/rmt.h index da8f629..b851045 100644 --- a/src/rmt.h +++ b/src/rmt.h @@ -1,5 +1,5 @@ /* Definitions for communicating with a remote tape drive. - Copyright (C) 1988, 1992, 1996, 1997 Free Software Foundation, Inc. + Copyright 1988, 1992, 1996, 1997, 2001 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -32,12 +32,12 @@ int rmt_ioctl__ PARAMS ((int, int, char *)); #define _remdev(Path) \ (!force_local_option && (rmt_path__ = strchr (Path, ':')) \ - && rmt_path__ > (Path) && rmt_path__[-1] != '/') + && rmt_path__ > (Path) && ! memchr (Path, rmt_path__ - (Path), '/')) #define _isrmt(Fd) \ ((Fd) >= __REM_BIAS) -#define __REM_BIAS 128 +#define __REM_BIAS (1 << 30) #ifndef O_CREAT # define O_CREAT 01000 @@ -52,7 +52,6 @@ int rmt_ioctl__ PARAMS ((int, int, char *)); #define rmtstat(Path, Buffer) \ (_remdev (Path) ? (errno = EOPNOTSUPP), -1 : stat (Path, Buffer)) - /* FIXME: errno should be read-only */ #define rmtcreat(Path, Mode, Command) \ (_remdev (Path) \ @@ -61,7 +60,6 @@ int rmt_ioctl__ PARAMS ((int, int, char *)); #define rmtlstat(Path, Buffer) \ (_remdev (Path) ? (errno = EOPNOTSUPP), -1 : lstat (Path, Buffer)) - /* FIXME: errno should be read-only */ #define rmtread(Fd, Buffer, Length) \ (_isrmt (Fd) ? rmt_read__ (Fd - __REM_BIAS, Buffer, Length) \ @@ -84,15 +82,12 @@ int rmt_ioctl__ PARAMS ((int, int, char *)); #define rmtdup(Fd) \ (_isrmt (Fd) ? (errno = EOPNOTSUPP), -1 : dup (Fd)) - /* FIXME: errno should be read-only */ #define rmtfstat(Fd, Buffer) \ (_isrmt (Fd) ? (errno = EOPNOTSUPP), -1 : fstat (Fd, Buffer)) - /* FIXME: errno should be read-only */ #define rmtfcntl(Fd, Command, Argument) \ (_isrmt (Fd) ? (errno = EOPNOTSUPP), -1 : fcntl (Fd, Command, Argument)) - /* FIXME: errno should be read-only */ #define rmtisatty(Fd) \ (_isrmt (Fd) ? 0 : isatty (Fd))