aboutsummaryrefslogtreecommitdiff
path: root/bin/dd/position.c
diff options
context:
space:
mode:
Diffstat (limited to 'bin/dd/position.c')
-rw-r--r--bin/dd/position.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/bin/dd/position.c b/bin/dd/position.c
index a7dd733f0bae..6cb6643982dc 100644
--- a/bin/dd/position.c
+++ b/bin/dd/position.c
@@ -191,10 +191,11 @@ pos_out(void)
/* Read it. */
for (cnt = 0; cnt < out.offset; ++cnt) {
- check_terminate();
- if ((n = read(out.fd, out.db, out.dbsz)) > 0)
+ before_io();
+ n = read(out.fd, out.db, out.dbsz);
+ after_io();
+ if (n > 0)
continue;
- check_terminate();
if (n == -1)
err(1, "%s", out.name);
@@ -209,9 +210,9 @@ pos_out(void)
err(1, "%s", out.name);
while (cnt++ < out.offset) {
- check_terminate();
+ before_io();
n = write(out.fd, out.db, out.dbsz);
- check_terminate();
+ after_io();
if (n == -1)
err(1, "%s", out.name);
if (n != out.dbsz)