summaryrefslogtreecommitdiff
path: root/bin/dd
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2006-11-07 07:10:25 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2006-11-07 07:10:25 +0000
commitd2923a164a7da5be0fd25d82a6ce33eb85ba84cc (patch)
tree885cdd7a62cb4973e9313644cfa528e49f918468 /bin/dd
parent9593ed3a1132092eb72c5c882095e62a3872ae76 (diff)
fix skipping when reading from a tty; reported by Karel Kulhavy
<clock at twibright dot com>; ok deraadt@
Diffstat (limited to 'bin/dd')
-rw-r--r--bin/dd/position.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/bin/dd/position.c b/bin/dd/position.c
index e146c2b2261..6c6b98d80ff 100644
--- a/bin/dd/position.c
+++ b/bin/dd/position.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: position.c,v 1.7 2003/06/11 23:42:12 deraadt Exp $ */
+/* $OpenBSD: position.c,v 1.8 2006/11/07 07:10:24 otto Exp $ */
/* $NetBSD: position.c,v 1.4 1995/03/21 09:04:12 cgd Exp $ */
/*-
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)position.c 8.3 (Berkeley) 4/2/94";
#else
-static char rcsid[] = "$OpenBSD: position.c,v 1.7 2003/06/11 23:42:12 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: position.c,v 1.8 2006/11/07 07:10:24 otto Exp $";
#endif
#endif /* not lint */
@@ -70,8 +70,8 @@ pos_in(void)
off_t cnt;
int warned;
- /* If not a pipe or tape device, try to seek on it. */
- if (!(in.flags & (ISPIPE|ISTAPE))) {
+ /* If not a pipe, tape or char device, try to seek on it. */
+ if (!(in.flags & (ISPIPE|ISTAPE|ISCHR))) {
if (lseek(in.fd, in.offset * in.dbsz, SEEK_CUR) == -1)
err(1, "%s", in.name);
return;