<div dir="ltr">Apparently this is a thing people like to do, and they use shell while<br>loops to do it (because cpio only reads one input file at a time from<br>stdin).<br><br>To make this work, we need to (a) exit with a failure status rather than<br>success if we hit EOF (we should never normally hit EOF because we<br>should read a TRAILER!!! first), and (b) skip to the end of the<br>TRAILER!!! record rather than just exiting immediately (so that the<br>_next_ cpio to run can start reading stdin at the start of a record,<br>rather than partway through the TRAILER!!! record that caused this cpio<br>to stop).<br><br>(The error message change in x8u is for the usual "it's harder to debug<br>if two different failure cases in the code output the exact same error<br>message", in this case "bad header".)<br>---<br> tests/cpio.test   | 13 +++++++++++++<br> toys/posix/cpio.c |  5 +++--<br> 2 files changed, 16 insertions(+), 2 deletions(-)<br></div>