diff options
author | Elliott Hughes <enh@google.com> | 2021-02-23 14:24:19 -0800 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2021-02-23 19:46:52 -0600 |
commit | 1ba53eead1ab9787e77dc43196b8402ec96e7fd4 (patch) | |
tree | 8c2b984e074cdf00babbb26b51f3a4c7f7644a66 /toys/posix/getconf.c | |
parent | d57dddaf264c57df6e7efdcd294d39060ae3e199 (diff) | |
download | toybox-1ba53eead1ab9787e77dc43196b8402ec96e7fd4.tar.gz |
dd: simplify signal handling and fix status output.
Other dd implementations always show the status on exit, whether success
or failure. Fix that by using xsigatexit() (and clarify the comment for
that function a little, since it didn't previously address the "at exit"
part of its behavior at all).
This also fixes SIGUSR1 behavior so that we show the status immediately
rather than on the next trip round the read/write loop.
Tested with `dd of=/dev/full`, sending SIGUSR1 twice from another shell
(to see the status immediately each time, without exiting), then hitting
^C (to see the status and then exiting), then restarting dd and hitting
enter (to see a write error followed by the status before exiting).
Bug: https://issuetracker.google.com/177017283
Diffstat (limited to 'toys/posix/getconf.c')
0 files changed, 0 insertions, 0 deletions