diff options
author | Brian Feldman <green@FreeBSD.org> | 1999-08-28 03:37:38 +0000 |
---|---|---|
committer | Brian Feldman <green@FreeBSD.org> | 1999-08-28 03:37:38 +0000 |
commit | ff8bb989ab1a7a16f1f6b6586f61ad54f2f690d8 (patch) | |
tree | 3e2992e26fcc13d2fc9c04e3ba4d0c5d47a7bf3a | |
parent | fbe39a1af1112ca8e2643913eeb805561eb84b41 (diff) | |
download | src-ff8bb989ab1a7a16f1f6b6586f61ad54f2f690d8.tar.gz src-ff8bb989ab1a7a16f1f6b6586f61ad54f2f690d8.zip |
Relax things a bit. Not having FIODTYPE will be a warning for now.
Pointy hat: green
Pointed out by: peter
Notes
Notes:
svn path=/head/; revision=50487
-rw-r--r-- | bin/dd/dd.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/bin/dd/dd.c b/bin/dd/dd.c index c80ed685312b..9ac4f86647e2 100644 --- a/bin/dd/dd.c +++ b/bin/dd/dd.c @@ -232,14 +232,18 @@ getfdtype(io) if (fstat(io->fd, &sb)) err(1, "%s", io->name); if (S_ISCHR(sb.st_mode) || S_ISBLK(sb.st_mode)) { - if (ioctl(io->fd, FIODTYPE, &type) == -1) - err(1, "%s", io->name); - if (type & D_TAPE) - io->flags |= ISTAPE; - else if (type & D_DISK) - io->flags |= ISDISK; - if (S_ISCHR(sb.st_mode) && (type & D_TAPE) == 0) - io->flags |= ISCHR; + if (ioctl(io->fd, FIODTYPE, &type) == -1) { + warn("%s", io->name); + if (S_ISCHR(sb.st_mode)) + io->flags |= ISCHR; + } else { + if (type & D_TAPE) + io->flags |= ISTAPE; + else if (type & D_DISK) + io->flags |= ISDISK; + if (S_ISCHR(sb.st_mode) && (type & D_TAPE) == 0) + io->flags |= ISCHR; + } } else if (!S_ISREG(sb.st_mode)) io->flags |= ISPIPE; } |