summaryrefslogtreecommitdiffstats
path: root/bin/dd
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1998-02-24 01:45:05 +0000
committerbde <bde@FreeBSD.org>1998-02-24 01:45:05 +0000
commitb54fa2acf79cee85b0392eb6b143c0fc2e754aa5 (patch)
treea6d812689554400fbd4d5ee867722d826ace4d83 /bin/dd
parent5d07031ba38c6dd01d687ec07522c84fc5c2d299 (diff)
downloadFreeBSD-src-b54fa2acf79cee85b0392eb6b143c0fc2e754aa5.zip
FreeBSD-src-b54fa2acf79cee85b0392eb6b143c0fc2e754aa5.tar.gz
Exit with a nonzero status if we get killed by a SIGINT. POSIX.2
specifies exiting with a zero status if the file was copied successfully, and with a nonzero status if an error occurred. We are too sloppy to tell if the file was copied successfully when we get killed by a SIGINT, but it is unlikely to have been. Added a comment about related sloppiness (calling exit() from a signal handler).
Diffstat (limited to 'bin/dd')
-rw-r--r--bin/dd/misc.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/bin/dd/misc.c b/bin/dd/misc.c
index 7270150..fcd5dd4 100644
--- a/bin/dd/misc.c
+++ b/bin/dd/misc.c
@@ -34,7 +34,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: misc.c,v 1.10 1997/12/15 20:37:43 eivind Exp $
+ * $Id: misc.c,v 1.11 1998/02/11 02:23:31 asami Exp $
*/
#ifndef lint
@@ -100,9 +100,10 @@ summaryx(notused)
/* ARGSUSED */
void
-terminate(notused)
- int notused;
+terminate(sig)
+ int sig;
{
- exit(0);
+ /* XXX exit() shouldn't call exit() from a signal handler. */
+ exit(sig == 0 ? 0 : 1);
}
OpenPOWER on IntegriCloud