On 11/09/2017 11:38 AM, Eric Blake wrote: > On 11/08/2017 04:56 PM, Alistair Francis wrote: [...] >> exit(-1); } qemu_thread_create(&threads[n_threads], "test", func, >> &data[n_threads], @@ -417,7 +418,7 @@ static void >> gtest_stress_10_5(void) >> >> static void usage(int argc, char *argv[]) { - fprintf(stderr, >> "Usage: %s [nreaders [ perf | stress ] ]\n", argv[0]); + >> error_report("Usage: %s [nreaders [ perf | stress ] ]", >> argv[0]); exit(-1); > > Separate patch - but 'exit(-1)' is almost always wrong (it gives > status 255 through wait()/waitpid(); meanwhile waitid() is required > by POSIX to get at the full 32-bit value except that Linux doesn't > obey that requirement). A process where wait() returns 255 makes > xargs behave differently. We really want exit(1).
$ git grep 'exit(-' origin/master | wc -l 60 Candidate for another mechanical patch? > >> +++ b/tests/tcg/linux-test.c @@ -51,7 +51,7 @@ void error1(const >> char *filename, int line, const char *fmt, ...) va_start(ap, >> fmt); fprintf(stderr, "%s:%d: ", filename, line); >> vfprintf(stderr, fmt, ap); - fprintf(stderr, "\n"); + >> error_report(""); > > Umm, a blank line is not a useful error. This hunk is bogus; we > probably want to stick with fprintf() for the entire message. =)