Skip to content

Commit 80082b3

Browse files
author
oech3
committed
dd: don't fail echo 1 | dd *flag=nocache
1 parent 47d7c76 commit 80082b3

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

src/uu/dd/src/dd.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// For the full copyright and license information, please view the LICENSE
44
// file that was distributed with this source code.
55

6-
// spell-checker:ignore fname, ftype, tname, fpath, specfile, testfile, unspec, ifile, ofile, outfile, fullblock, urand, fileio, atoe, atoibm, behaviour, bmax, bremain, cflags, creat, ctable, ctty, datastructures, doesnt, etoa, fileout, fname, gnudd, iconvflags, iseek, nocache, noctty, noerror, nofollow, nolinks, nonblock, oconvflags, oseek, outfile, parseargs, rlen, rmax, rremain, rsofar, rstat, sigusr, wlen, wstat oconv canonicalized FADV DONTNEED ESPIPE SPIPE bufferedoutput, SETFL
6+
// spell-checker:ignore fname, ftype, tname, fpath, specfile, testfile, unspec, ifile, ofile, outfile, fullblock, urand, fileio, atoe, atoibm, behaviour, bmax, bremain, cflags, creat, ctable, ctty, datastructures, doesnt, etoa, fileout, fname, gnudd, iconvflags, iseek, nocache, noctty, noerror, nofollow, nolinks, nonblock, oconvflags, oseek, outfile, parseargs, rlen, rmax, rremain, rsofar, rstat, sigusr, wlen, wstat oconv canonicalized FADV DONTNEED ESPIPE bufferedoutput, SETFL
77

88
mod blocks;
99
mod bufferedoutput;
@@ -314,8 +314,7 @@ impl Source {
314314
fadvise(f, offset, std::num::NonZeroU64::new(len), DontNeed)?;
315315
Ok(())
316316
}
317-
// fadvise for nonseekable returns this error. We manually do that...
318-
_ => Err(rustix::io::Errno::SPIPE.into()),
317+
_ => Ok(()), // ESPIPE, but GNU silently ignore it
319318
}
320319
}
321320
}
@@ -700,8 +699,7 @@ impl Dest {
700699
fadvise(f, offset, std::num::NonZeroU64::new(len), DontNeed)?;
701700
Ok(())
702701
}
703-
// fadvise for nonseekable returns this error. We manually do that...
704-
_ => Err(rustix::io::Errno::SPIPE.into()),
702+
_ => Ok(()), // ESPIPE, but GNU silently ignore it
705703
}
706704
}
707705
}

0 commit comments

Comments
 (0)