summaryrefslogtreecommitdiff
path: root/usr.bin/patch/patch.c
diff options
context:
space:
mode:
authorlukem <lukem@NetBSD.org>2007-10-14 04:54:34 +0000
committerlukem <lukem@NetBSD.org>2007-10-14 04:54:34 +0000
commitbd560fde318dda837a52bbe46abc3d2916a129a5 (patch)
tree6e5c08e98d1a30a5605adfb30f0f65e118806848 /usr.bin/patch/patch.c
parentee740853d73dbc89ddad775377a6ad5a7350479d (diff)
Convert to using raise_default_signal(3).
Diffstat (limited to 'usr.bin/patch/patch.c')
-rw-r--r--usr.bin/patch/patch.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/usr.bin/patch/patch.c b/usr.bin/patch/patch.c
index 283f3395e67..63404f85565 100644
--- a/usr.bin/patch/patch.c
+++ b/usr.bin/patch/patch.c
@@ -1,4 +1,4 @@
-/* $NetBSD: patch.c,v 1.24 2005/03/25 23:55:02 wiz Exp $ */
+/* $NetBSD: patch.c,v 1.25 2007/10/14 04:54:34 lukem Exp $ */
/* patch - a program to apply diffs to original files
*
@@ -25,7 +25,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: patch.c,v 1.24 2005/03/25 23:55:02 wiz Exp $");
+__RCSID("$NetBSD: patch.c,v 1.25 2007/10/14 04:54:34 lukem Exp $");
#endif /* not lint */
#include "INTERN.h"
@@ -39,6 +39,7 @@ __RCSID("$NetBSD: patch.c,v 1.24 2005/03/25 23:55:02 wiz Exp $");
#include <stdlib.h>
#include <unistd.h>
+#include <util.h>
/* procedures */
static void reinitialize_almost_everything(void);
@@ -911,8 +912,8 @@ similar(const char *a, const char *b, size_t len)
/* Exit with cleanup. */
-void
-my_exit(int status)
+static void
+my_cleanup(void)
{
Unlink(TMPINNAME);
if (!toutkeep) {
@@ -922,5 +923,20 @@ my_exit(int status)
Unlink(TMPREJNAME);
}
Unlink(TMPPATNAME);
+}
+
+
+void
+my_exit(int status)
+{
+ my_cleanup();
exit(status);
}
+
+void
+my_sig_exit(int signo)
+{
+ my_cleanup();
+ (void)raise_default_signal(signo);
+ _exit(1);
+}