void ftree_chk(void) { FTREE *ft; int wban = 0; /* * make sure all dir access times were reset. */ if (tflag) atdir_end(); /* * walk down list and check reference count. Print out those members * that never had a match */ for (ft = fthead; ft != NULL; ft = ft->fow) { if ((ft->refcnt > 0) || ft->newercnt > 0 || ft->chflg) continue; if (wban == 0) { paxwarn(1,"WARNING! These file names were not selected:"); ++wban; } (void)fprintf(stderr, "%s\n", ft->fname); } }
__dead static void sig_cleanup(int which_sig) { /* * restore modes and times for any dirs we may have created * or any dirs we may have read. Set vflag and vfpart so the user * will clearly see the message on a line by itself. */ vflag = vfpart = 1; #ifdef SIGXCPU if (which_sig == SIGXCPU) tty_warn(1, "CPU time limit reached, cleaning up."); else #endif tty_warn(1, "Signal caught, cleaning up."); /* delete any open temporary file */ if (xtmp_name) (void)unlink(xtmp_name); ar_close(); proc_dir(); if (tflag) atdir_end(); (void)raise_default_signal(which_sig); exit(1); }
void sig_cleanup(int which_sig) { char errbuf[80]; /* * restore modes and times for any dirs we may have created * or any dirs we may have read. Set vflag and vfpart so the user * will clearly see the message on a line by itself. */ vflag = vfpart = 1; /* paxwarn() uses stdio; fake it as well as we can */ if (which_sig == SIGXCPU) strlcpy(errbuf, "CPU time limit reached, cleaning up.\n", sizeof errbuf); else strlcpy(errbuf, "Signal caught, cleaning up.\n", sizeof errbuf); (void) write(STDERR_FILENO, errbuf, strlen(errbuf)); ar_close(); /* XXX signal race */ proc_dir(); /* XXX signal race */ if (tflag) atdir_end(); /* XXX signal race */ _exit(1); }
void sig_cleanup(int which_sig) { /* * Restore modes and times for any dirs we may have created * or any dirs we may have read. Set vflag and vfpart so the * user will clearly see the message on a line by itself. */ vflag = vfpart = 1; /* paxwarn() uses stdio; fake it as well as we can */ if (which_sig == SIGXCPU) dprintf(STDERR_FILENO, "\nCPU time limit reached, cleaning up.\n"); else if (!which_sig) dprintf(STDERR_FILENO, "\nCowardly giving up, trying to clean up.\n"); else dprintf(STDERR_FILENO, "\nSignal caught, cleaning up.\n"); ar_close(1); sltab_process(1); proc_dir(1); if (tflag) atdir_end(); _exit(1); }
void sig_cleanup(int which_sig) { char errbuf[80]; /* * restore modes and times for any dirs we may have created * or any dirs we may have read. */ /* paxwarn() uses stdio; fake it as well as we can */ if (which_sig == SIGXCPU) strlcpy(errbuf, "\nCPU time limit reached, cleaning up.\n", sizeof errbuf); else strlcpy(errbuf, "\nSignal caught, cleaning up.\n", sizeof errbuf); (void) write(STDERR_FILENO, errbuf, strlen(errbuf)); ar_close(1); sltab_process(1); proc_dir(1); if (tflag) atdir_end(); _exit(1); }
void sig_cleanup(int which_sig) { /* * restore modes and times for any dirs we may have created * or any dirs we may have read. Set vflag and vfpart so the user * will clearly see the message on a line by itself. */ vflag = vfpart = 1; if (which_sig == SIGXCPU) paxwarn(0, "Cpu time limit reached, cleaning up."); else paxwarn(0, "Signal caught, cleaning up."); ar_close(); proc_dir(); if (tflag) atdir_end(); exit(1); }
void sig_cleanup(int which_sig) { /* * restore modes and times for any dirs we may have created * or any dirs we may have read. */ /* paxwarn() uses stdio; fake it as well as we can */ if (which_sig == SIGXCPU) dprintf(STDERR_FILENO, "\nCPU time limit reached, cleaning up.\n"); else dprintf(STDERR_FILENO, "\nSignal caught, cleaning up.\n"); ar_close(1); sltab_process(1); proc_dir(1); if (tflag) atdir_end(); _exit(1); }
static void sig_cleanup(int which_sig) { /* * The definition of this array doubles as compile-time assert * on the size of long, off_t, and whether LONG_OFF_T is used, * or not, correctly; target size is 80, error size -1. */ char errbuf[((sizeof(long) >= 4) && (sizeof(ot_type) >= 4) && (sizeof(ot_type) == sizeof(off_t))) ? 80 : -1]; /* * restore modes and times for any dirs we may have created * or any dirs we may have read. Set vflag and vfpart so the user * will clearly see the message on a line by itself. */ vflag = vfpart = 1; /* paxwarn() uses stdio; fake it as well as we can */ if (which_sig == SIGXCPU) strlcpy(errbuf, "CPU time limit reached, cleaning up.\n", sizeof errbuf); else strlcpy(errbuf, "Signal caught, cleaning up.\n", sizeof errbuf); if (!write(STDERR_FILENO, errbuf, strlen(errbuf))) { /* dummy, to keep fortified gcc quiet */ errbuf[0] = '\0'; } ar_close(); /* XXX signal race */ proc_dir(); /* XXX signal race */ if (tflag) atdir_end(); /* XXX signal race */ _exit(1); }