aboutsummaryrefslogtreecommitdiff
path: root/toys/pending
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2019-07-09 09:49:12 -0700
committerRob Landley <rob@landley.net>2019-07-09 16:22:59 -0500
commit4c6f35ea529ebca9b2dfb6d7c79cade30118fd75 (patch)
treed315ec75d91d9e1a75286d6674b90535aedae30a /toys/pending
parenta5da2e966ad67c2f3667d75b4600c5d4e6ea0c53 (diff)
downloadtoybox-4c6f35ea529ebca9b2dfb6d7c79cade30118fd75.tar.gz
dd: fix seek= on stdout.
Diffstat (limited to 'toys/pending')
-rw-r--r--toys/pending/dd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/toys/pending/dd.c b/toys/pending/dd.c
index e37f8b28..0c447f74 100644
--- a/toys/pending/dd.c
+++ b/toys/pending/dd.c
@@ -188,7 +188,7 @@ void dd_main()
// seek/truncate as necessary. We handled position zero truncate with
// O_TRUNC on open, so output to /dev/null and such doesn't error.
- if (TT.out.fd!=1 && (bs = TT.out.offset*TT.out.sz)) {
+ if ((bs = TT.out.offset*TT.out.sz)) {
xlseek(TT.out.fd, bs, SEEK_CUR);
if (trunc && ftruncate(TT.out.fd, bs)) perror_exit("ftruncate");
}