diff options
author | jlam <jlam@pkgsrc.org> | 2004-08-21 03:28:49 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2004-08-21 03:28:49 +0000 |
commit | 9d7093238fefcd6d2b99bd9995a098c60e7399d9 (patch) | |
tree | 5a31626ba82d66abe9e0eb31a61d5759fa1813fa /archivers/pax/files/pax.c | |
parent | ee9c3ffb7c5b43c161600ec2c7a92acbf866f027 (diff) | |
download | pkgsrc-9d7093238fefcd6d2b99bd9995a098c60e7399d9.tar.gz |
Update archivers/pax to 20040802 (latest version on src HEAD). Changes
from previous include:
- include a pax2nbcompat script to ease importing from src HEAD
into pkgsrc.
* for copy mode, show more meaningful information on SIGINFO.
Diffstat (limited to 'archivers/pax/files/pax.c')
-rw-r--r-- | archivers/pax/files/pax.c | 41 |
1 files changed, 30 insertions, 11 deletions
diff --git a/archivers/pax/files/pax.c b/archivers/pax/files/pax.c index a9b141ed533..01da438a287 100644 --- a/archivers/pax/files/pax.c +++ b/archivers/pax/files/pax.c @@ -1,4 +1,4 @@ -/* $NetBSD: pax.c,v 1.6 2004/06/20 10:11:02 grant Exp $ */ +/* $NetBSD: pax.c,v 1.7 2004/08/21 03:28:56 jlam Exp $ */ /*- * Copyright (c) 1992 Keith Muller. @@ -36,20 +36,21 @@ #if HAVE_CONFIG_H #include "config.h" #endif +#if HAVE_NBTOOL_CONFIG_H +#include "nbtool_config.h" +#endif + #include <nbcompat.h> #if HAVE_SYS_CDEFS_H #include <sys/cdefs.h> #endif -#if defined(__COPYRIGHT) && !defined(lint) +#if !defined(lint) __COPYRIGHT("@(#) Copyright (c) 1992, 1993\n\ The Regents of the University of California. All rights reserved.\n"); -#endif /* not lint */ - -#if defined(__RCSID) && !defined(lint) #if 0 static char sccsid[] = "@(#)pax.c 8.2 (Berkeley) 4/18/94"; #else -__RCSID("$NetBSD: pax.c,v 1.6 2004/06/20 10:11:02 grant Exp $"); +__RCSID("$NetBSD: pax.c,v 1.7 2004/08/21 03:28:56 jlam Exp $"); #endif #endif /* not lint */ @@ -368,9 +369,11 @@ sig_cleanup(int which_sig) * will clearly see the message on a line by itself. */ vflag = vfpart = 1; +#ifdef SIGXCPU if (which_sig == SIGXCPU) tty_warn(0, "CPU time limit reached, cleaning up."); else +#endif tty_warn(0, "Signal caught, cleaning up."); /* delete any open temporary file */ @@ -447,11 +450,23 @@ gen_init(void) */ if ((sigemptyset(&s_mask) < 0) || (sigaddset(&s_mask, SIGTERM) < 0) || (sigaddset(&s_mask,SIGINT) < 0)||(sigaddset(&s_mask,SIGHUP) < 0) || - (sigaddset(&s_mask,SIGPIPE) < 0)||(sigaddset(&s_mask,SIGQUIT)<0) || - (sigaddset(&s_mask,SIGXCPU) < 0)||(sigaddset(&s_mask,SIGXFSZ)<0)) { + (sigaddset(&s_mask,SIGPIPE) < 0)||(sigaddset(&s_mask,SIGQUIT)<0)){ + tty_warn(1, "Unable to set up signal mask"); + return(-1); + } +#ifdef SIGXCPU + if (sigaddset(&s_mask,SIGXCPU) < 0) { + tty_warn(1, "Unable to set up signal mask"); + return(-1); + } +#endif +#ifdef SIGXFSZ + if (sigaddset(&s_mask,SIGXFSZ) < 0) { tty_warn(1, "Unable to set up signal mask"); return(-1); } +#endif + memset(&n_hand, 0, sizeof n_hand); n_hand.sa_mask = s_mask; n_hand.sa_flags = 0; @@ -477,15 +492,19 @@ gen_init(void) (sigaction(SIGQUIT, &o_hand, &o_hand) < 0)) goto out; +#ifdef SIGXCPU if ((sigaction(SIGXCPU, &n_hand, &o_hand) < 0) && (o_hand.sa_handler == SIG_IGN) && (sigaction(SIGXCPU, &o_hand, &o_hand) < 0)) goto out; - +#endif n_hand.sa_handler = SIG_IGN; - if ((sigaction(SIGPIPE, &n_hand, &o_hand) < 0) || - (sigaction(SIGXFSZ, &n_hand, &o_hand) < 0)) + if (sigaction(SIGPIPE, &n_hand, &o_hand) < 0) goto out; +#ifdef SIGXFSZ + if (sigaction(SIGXFSZ, &n_hand, &o_hand) < 0) + goto out; +#endif return(0); out: |