From 958736290460f54ba182aef7c2da58ec0f806f62 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Sun, 14 Jan 2007 20:28:09 +0000 Subject: [PATCH] * Exit non-zero if one process crashed. --- doc/zzuf.1 | 4 ++++ src/zzuf.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/zzuf.1 b/doc/zzuf.1 index b499cb4..8fa7055 100644 --- a/doc/zzuf.1 +++ b/doc/zzuf.1 @@ -220,6 +220,10 @@ Display a short help message and exit. .TP \fB\-V\fR, \fB\-\-version\fR Output version information and exit. +.SH DIAGNOSTICS +.PP +Exit status is zero if no child process crashed. If one or several children +crashed, \fBzzuf\fR exits with status 1. .SH EXAMPLES .PP Fuzz the input of the \fBcat\fR program using default settings: diff --git a/src/zzuf.c b/src/zzuf.c index fa1e0a1..1a4acfa 100644 --- a/src/zzuf.c +++ b/src/zzuf.c @@ -335,7 +335,7 @@ int main(int argc, char *argv[]) free(newargv); free(child_list); - return EXIT_SUCCESS; + return crashes ? EXIT_FAILURE : EXIT_SUCCESS; } static void loop_stdin(void)