Changeset 1634 for zzuf


Ignore:
Timestamp:
Jan 9, 2007, 12:22:09 PM (13 years ago)
Author:
Sam Hocevar
Message:
  • Don’t report exit status by default.
  • Add -x/--check-exit to get back to the previous behaviour.
Location:
zzuf/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • zzuf/trunk/doc/zzuf.1

    r1633 r1634  
    6161is 1, meaning \fBzzuf\fR will stop as soon as one child has crashed. A process
    6262is considered to have crashed if any signal (such as, but not limited to,
    63 \fBSIGSEGV\fR) caused it to exit.
     63\fBSIGSEGV\fR) caused it to exit. If the \fB\-x\fR flag is used, this will
     64also include processes that exit with a non-zero status.
    6465
    6566This option is only relevant if the \fB\-s\fR flag is used with an interval
     
    189190situations. See also the \fB\-B\fR flag.
    190191.TP
     192\fB\-x\fR, \fB\-\-check\-exit\fR
     193Report processes that exit with a non-zero status. By default only processes
     194that crash due to a signal are reported.
     195.TP
    191196\fB\-h\fR, \fB\-\-help\fR
    192197Display a short help message and exit.
  • zzuf/trunk/src/zzuf.c

    r1633 r1634  
    8080static int maxbytes = -1;
    8181static int md5 = 0;
     82static int checkexit = 0;
    8283static double maxtime = -1.0;
    8384
     
    127128            { "signal",      0, NULL, 'S' },
    128129            { "max-time",    1, NULL, 'T' },
     130            { "check-exit",  0, NULL, 'x' },
    129131            { "help",        0, NULL, 'h' },
    130132            { "version",     0, NULL, 'v' },
    131133        };
    132         int c = getopt_long(argc, argv, "B:cC:dE:F:iI:MnP:qr:R:s:ST:hv",
     134        int c = getopt_long(argc, argv, "B:cC:dE:F:iI:MnP:qr:R:s:ST:xhv",
    133135                            long_options, &option_index);
    134136#   else
    135137#       define MOREINFO "Try `%s -h' for more information.\n"
    136         int c = getopt(argc, argv, "B:cC:dE:F:iI:MnP:qr:R:s:ST:hv");
     138        int c = getopt(argc, argv, "B:cC:dE:F:iI:MnP:qr:R:s:ST:xhv");
    137139#   endif
    138140        if(c == -1)
     
    206208        case 'T': /* --max-time */
    207209            maxtime = atof(optarg);
     210            break;
     211        case 'x': /* --check-exit */
     212            checkexit = 1;
    208213            break;
    209214        case 'h': /* --help */
     
    516521            continue;
    517522
    518         if(WIFEXITED(status) && WEXITSTATUS(status))
     523        if(checkexit && WIFEXITED(status) && WEXITSTATUS(status))
    519524        {
    520525            fprintf(stdout, "zzuf[seed=%i]: exit %i\n",
     
    660665static void usage(void)
    661666{
    662     printf("Usage: zzuf [-cdiMnqS] [-r ratio] [-s seed | -s start:stop]\n");
    663     printf("                       [-F forks] [-C crashes] [-B bytes] [-T seconds]\n");
    664     printf("                       [-P protect] [-R refuse]\n");
    665     printf("                       [-I include] [-E exclude] [PROGRAM [ARGS]...]\n");
     667    printf("Usage: zzuf [-cdiMnqSx] [-r ratio] [-s seed | -s start:stop]\n");
     668    printf("                        [-F forks] [-C crashes] [-B bytes] [-T seconds]\n");
     669    printf("                        [-P protect] [-R refuse]\n");
     670    printf("                        [-I include] [-E exclude] [PROGRAM [ARGS]...]\n");
    666671#   ifdef HAVE_GETOPT_LONG
    667672    printf("       zzuf -h | --help\n");
     
    693698    printf("  -S, --signal             prevent children from diverting crashing signals\n");
    694699    printf("  -T, --max-time <n>       kill children that run for more than <n> seconds\n");
     700    printf("  -x, --check-exit         report processes that exit with a non-zero status\n");
    695701    printf("  -h, --help               display this help and exit\n");
    696702    printf("  -v, --version            output version information and exit\n");
     
    714720    printf("  -S               prevent children from diverting crashing signals\n");
    715721    printf("  -T <n>           kill children that run for more than <n> seconds\n");
     722    printf("  -x               report processes that exit with a non-zero status\n");
    716723    printf("  -h               display this help and exit\n");
    717724    printf("  -v               output version information and exit\n");
Note: See TracChangeset for help on using the changeset viewer.