summaryrefslogtreecommitdiff
path: root/bin/pax/ar_subs.c
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2014-05-23 19:47:50 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2014-05-23 19:47:50 +0000
commit1dfb7d5d601779a9070773b7536087d4f5068450 (patch)
tree260f470a398dd062f520cfdacd3c0aee423b112a /bin/pax/ar_subs.c
parent75b8f6b17f8dfe9cbeff32989622d6ba43d87ffb (diff)
Make the signal handler safe: block signals when updating data-structures
that are walked by routines called from the signal handler and use dprintf() instead fprintf() in ar_close(). ok millert@
Diffstat (limited to 'bin/pax/ar_subs.c')
-rw-r--r--bin/pax/ar_subs.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/bin/pax/ar_subs.c b/bin/pax/ar_subs.c
index bbefbe94398..48493bd17ab 100644
--- a/bin/pax/ar_subs.c
+++ b/bin/pax/ar_subs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ar_subs.c,v 1.38 2014/02/05 20:35:42 halex Exp $ */
+/* $OpenBSD: ar_subs.c,v 1.39 2014/05/23 19:47:49 guenther Exp $ */
/* $NetBSD: ar_subs.c,v 1.5 1995/03/21 09:07:06 cgd Exp $ */
/*-
@@ -144,7 +144,7 @@ list(void)
*/
(void)(*frmt->end_rd)();
(void)sigprocmask(SIG_BLOCK, &s_mask, NULL);
- ar_close();
+ ar_close(0);
pat_chk();
}
@@ -359,8 +359,8 @@ popd:
*/
(void)(*frmt->end_rd)();
(void)sigprocmask(SIG_BLOCK, &s_mask, NULL);
- ar_close();
- proc_dir();
+ ar_close(0);
+ proc_dir(0);
pat_chk();
}
@@ -554,9 +554,9 @@ trailer:
wr_fin();
}
(void)sigprocmask(SIG_BLOCK, &s_mask, NULL);
- ar_close();
+ ar_close(0);
if (tflag)
- proc_dir();
+ proc_dir(0);
ftree_chk();
}
@@ -968,8 +968,8 @@ copy(void)
* multiple entry into the cleanup code.
*/
(void)sigprocmask(SIG_BLOCK, &s_mask, NULL);
- ar_close();
- proc_dir();
+ ar_close(0);
+ proc_dir(0);
ftree_chk();
}