X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Frmt.h;h=a01a630b6bfd9d58ae33e5aee0a9fb1031155afd;hb=04182eb50c49c9c7321a00b48ee5c049093e2fcd;hp=7b3c2982b6b8870ae242207cccbd9fcd98a49e78;hpb=1521a94b11b0b7a2fe2a8318207d7d6b4bdbf76b;p=chaz%2Ftar diff --git a/src/rmt.h b/src/rmt.h index 7b3c298..a01a630 100644 --- a/src/rmt.h +++ b/src/rmt.h @@ -24,7 +24,7 @@ ssize_t rmt_write__ PARAMS ((int, char *, size_t)); off_t rmt_lseek__ PARAMS ((int, off_t, int)); int rmt_ioctl__ PARAMS ((int, int, char *)); -/* A filename is remote if it contains a colon not preceeded by a slash, +/* A filename is remote if it contains a colon not preceded by a slash, to take care of `/:/' which is a shorthand for `/...//fs' on machines running OSF's Distributing Computing Environment (DCE) and Distributed File System (DFS). However, when --force-local, a @@ -37,7 +37,7 @@ int rmt_ioctl__ PARAMS ((int, int, char *)); #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,11 +60,10 @@ 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) \ - : full_read (Fd, Buffer, Length)) + : safe_read (Fd, Buffer, Length)) #define rmtwrite(Fd, Buffer, Length) \ (_isrmt (Fd) ? rmt_write__ (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))