summaryrefslogtreecommitdiffstats
path: root/bin/dd/dd.c
diff options
context:
space:
mode:
authorgreen <green@FreeBSD.org>1999-08-28 03:37:38 +0000
committergreen <green@FreeBSD.org>1999-08-28 03:37:38 +0000
commitc4aced089128ad99459cc1173169758dfcea0cea (patch)
treef445f1850cb675aa752d510cf864f0a3fc1b7807 /bin/dd/dd.c
parentd2b10320f08c5ea24be9ccdabd470fd8dcb308fe (diff)
downloadFreeBSD-src-c4aced089128ad99459cc1173169758dfcea0cea.zip
FreeBSD-src-c4aced089128ad99459cc1173169758dfcea0cea.tar.gz
Relax things a bit. Not having FIODTYPE will be a warning for now.
Pointy hat: green Pointed out by: peter
Diffstat (limited to 'bin/dd/dd.c')
-rw-r--r--bin/dd/dd.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/bin/dd/dd.c b/bin/dd/dd.c
index c80ed68..9ac4f86 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;
}
OpenPOWER on IntegriCloud