pax.c (b97fa2ef508bb1cc99621edb8b6d03845b55b8bd) | pax.c (a885d9dcf9631f6bc175a29bf5427c8218d1fbea) |
---|---|
1/*- 2 * Copyright (c) 1992 Keith Muller. 3 * Copyright (c) 1992, 1993 4 * The Regents of the University of California. All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * Keith Muller of the University of California, San Diego. 8 * --- 20 unchanged lines hidden (view full) --- 29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 35 * SUCH DAMAGE. 36 * | 1/*- 2 * Copyright (c) 1992 Keith Muller. 3 * Copyright (c) 1992, 1993 4 * The Regents of the University of California. All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * Keith Muller of the University of California, San Diego. 8 * --- 20 unchanged lines hidden (view full) --- 29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 35 * SUCH DAMAGE. 36 * |
37 * $Id$ | 37 * $Id: pax.c,v 1.8 1997/02/22 14:04:39 peter Exp $ |
38 */ 39 40#ifndef lint 41static char const copyright[] = 42"@(#) Copyright (c) 1992, 1993\n\ 43 The Regents of the University of California. All rights reserved.\n"; 44#endif /* not lint */ 45 --- 234 unchanged lines hidden (view full) --- 280{ 281 /* 282 * restore modes and times for any dirs we may have created 283 * or any dirs we may have read. Set vflag and vfpart so the user 284 * will clearly see the message on a line by itself. 285 */ 286 vflag = vfpart = 1; 287 if (which_sig == SIGXCPU) | 38 */ 39 40#ifndef lint 41static char const copyright[] = 42"@(#) Copyright (c) 1992, 1993\n\ 43 The Regents of the University of California. All rights reserved.\n"; 44#endif /* not lint */ 45 --- 234 unchanged lines hidden (view full) --- 280{ 281 /* 282 * restore modes and times for any dirs we may have created 283 * or any dirs we may have read. Set vflag and vfpart so the user 284 * will clearly see the message on a line by itself. 285 */ 286 vflag = vfpart = 1; 287 if (which_sig == SIGXCPU) |
288 warn(0, "Cpu time limit reached, cleaning up."); | 288 pax_warn(0, "Cpu time limit reached, cleaning up."); |
289 else | 289 else |
290 warn(0, "Signal caught, cleaning up."); | 290 pax_warn(0, "Signal caught, cleaning up."); |
291 292 ar_close(); 293 proc_dir(); 294 if (tflag) 295 atdir_end(); 296 exit(1); 297} 298 --- 61 unchanged lines hidden (view full) --- 360 * we deal with broken pipes via failed writes we ignore it. We also 361 * deal with any file size limit thorugh failed writes. Cpu time 362 * limits are caught and a cleanup is forced. 363 */ 364 if ((sigemptyset(&s_mask) < 0) || (sigaddset(&s_mask, SIGTERM) < 0) || 365 (sigaddset(&s_mask,SIGINT) < 0)||(sigaddset(&s_mask,SIGHUP) < 0) || 366 (sigaddset(&s_mask,SIGPIPE) < 0)||(sigaddset(&s_mask,SIGQUIT)<0) || 367 (sigaddset(&s_mask,SIGXCPU) < 0)||(sigaddset(&s_mask,SIGXFSZ)<0)) { | 291 292 ar_close(); 293 proc_dir(); 294 if (tflag) 295 atdir_end(); 296 exit(1); 297} 298 --- 61 unchanged lines hidden (view full) --- 360 * we deal with broken pipes via failed writes we ignore it. We also 361 * deal with any file size limit thorugh failed writes. Cpu time 362 * limits are caught and a cleanup is forced. 363 */ 364 if ((sigemptyset(&s_mask) < 0) || (sigaddset(&s_mask, SIGTERM) < 0) || 365 (sigaddset(&s_mask,SIGINT) < 0)||(sigaddset(&s_mask,SIGHUP) < 0) || 366 (sigaddset(&s_mask,SIGPIPE) < 0)||(sigaddset(&s_mask,SIGQUIT)<0) || 367 (sigaddset(&s_mask,SIGXCPU) < 0)||(sigaddset(&s_mask,SIGXFSZ)<0)) { |
368 warn(1, "Unable to set up signal mask"); | 368 pax_warn(1, "Unable to set up signal mask"); |
369 return(-1); 370 } 371 n_hand.sa_mask = s_mask; 372 n_hand.sa_flags = 0; 373 n_hand.sa_handler = sig_cleanup; 374 375 if ((sigaction(SIGHUP, &n_hand, &o_hand) < 0) && 376 (o_hand.sa_handler == SIG_IGN) && --- 22 unchanged lines hidden (view full) --- 399 400 n_hand.sa_handler = SIG_IGN; 401 if ((sigaction(SIGPIPE, &n_hand, &o_hand) < 0) || 402 (sigaction(SIGXFSZ, &n_hand, &o_hand) < 0)) 403 goto out; 404 return(0); 405 406 out: | 369 return(-1); 370 } 371 n_hand.sa_mask = s_mask; 372 n_hand.sa_flags = 0; 373 n_hand.sa_handler = sig_cleanup; 374 375 if ((sigaction(SIGHUP, &n_hand, &o_hand) < 0) && 376 (o_hand.sa_handler == SIG_IGN) && --- 22 unchanged lines hidden (view full) --- 399 400 n_hand.sa_handler = SIG_IGN; 401 if ((sigaction(SIGPIPE, &n_hand, &o_hand) < 0) || 402 (sigaction(SIGXFSZ, &n_hand, &o_hand) < 0)) 403 goto out; 404 return(0); 405 406 out: |
407 syswarn(1, errno, "Unable to set up signal handler"); | 407 sys_warn(1, errno, "Unable to set up signal handler"); |
408 return(-1); 409} | 408 return(-1); 409} |