ISDISK -> ISSEEK
Allow a device type of D_DISK or D_MEM to be ISSEEK.
This commit is contained in:
parent
49c684571a
commit
32952d4b37
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=51212
@ -222,8 +222,8 @@ getfdtype(io)
|
||||
} else {
|
||||
if (type & D_TAPE)
|
||||
io->flags |= ISTAPE;
|
||||
else if (type & D_DISK)
|
||||
io->flags |= ISDISK;
|
||||
else if (type & (D_DISK | D_MEM))
|
||||
io->flags |= ISSEEK;
|
||||
if (S_ISCHR(sb.st_mode) && (type & D_TAPE) == 0)
|
||||
io->flags |= ISCHR;
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ typedef struct {
|
||||
#define ISCHR 0x01 /* character device (warn on short) */
|
||||
#define ISPIPE 0x02 /* pipe (not truncatable) */
|
||||
#define ISTAPE 0x04 /* tape (not seekable) */
|
||||
#define ISDISK 0x08 /* disk (valid to seek on) */
|
||||
#define ISSEEK 0x08 /* valid to seek on */
|
||||
#define NOREAD 0x10 /* not readable */
|
||||
u_int flags;
|
||||
|
||||
|
@ -68,7 +68,7 @@ pos_in()
|
||||
size_t bcnt;
|
||||
|
||||
/* If not a character, pipe or tape device, try to seek on it. */
|
||||
if (!(in.flags & (ISCHR|ISPIPE|ISTAPE)) || in.flags & ISDISK) {
|
||||
if (!(in.flags & (ISCHR|ISPIPE|ISTAPE)) || in.flags & ISSEEK) {
|
||||
errno = 0;
|
||||
if (lseek(in.fd, in.offset * in.dbsz, SEEK_CUR) == -1 &&
|
||||
errno != 0)
|
||||
@ -126,7 +126,7 @@ pos_out()
|
||||
ssize_t n;
|
||||
|
||||
/* If not a character, pipe or tape device, try to seek on it. */
|
||||
if (!(out.flags & (ISCHR|ISPIPE|ISTAPE)) || out.flags & ISDISK) {
|
||||
if (!(out.flags & (ISCHR|ISPIPE|ISTAPE)) || out.flags & ISSEEK) {
|
||||
errno = 0;
|
||||
if (lseek(out.fd, out.offset * out.dbsz, SEEK_SET) == -1 &&
|
||||
errno != 0)
|
||||
|
Loading…
Reference in New Issue
Block a user