[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v4 04/45] tests: Replace fprintf(stderr, "*\n" w
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [Qemu-devel] [PATCH v4 04/45] tests: Replace fprintf(stderr, "*\n" with error_report() |
Date: |
Thu, 9 Nov 2017 11:48:04 -0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 |
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.
=)
- [Qemu-devel] [PATCH v4 00/45] Remove some of the fprintf(stderr, "*, Alistair Francis, 2017/11/08
- [Qemu-devel] [PATCH v4 03/45] Fixes after renaming __FUNCTION__ to __func__, Alistair Francis, 2017/11/08
- [Qemu-devel] [PATCH v4 01/45] audio: Replace AUDIO_FUNC with __func__, Alistair Francis, 2017/11/08
- [Qemu-devel] [PATCH v4 04/45] tests: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/11/08
- [Qemu-devel] [PATCH v4 07/45] hw/bt: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/11/08
- [Qemu-devel] [PATCH v4 06/45] hw/block: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/11/08
- [Qemu-devel] [PATCH v4 05/45] hw/arm: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/11/08
- [Qemu-devel] [PATCH v4 10/45] hw/cris: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/11/08
- [Qemu-devel] [PATCH v4 08/45] hw/char: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/11/08
- [Qemu-devel] [PATCH v4 12/45] hw/dma: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/11/08
- [Qemu-devel] [PATCH v4 11/45] hw/display: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/11/08