Re: Clean up some signal usage mainly related to Windows

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: Clean up some signal usage mainly related to Windows
Дата
Msg-id 4763d95f-3b8e-41cf-90aa-5961b8cba6c5@eisentraut.org
обсуждение исходный текст
Ответ на Re: Clean up some signal usage mainly related to Windows  (Nathan Bossart <nathandbossart@gmail.com>)
Ответы Re: Clean up some signal usage mainly related to Windows  (Nathan Bossart <nathandbossart@gmail.com>)
Список pgsql-hackers
On 06.12.23 17:18, Nathan Bossart wrote:
> On Wed, Dec 06, 2023 at 10:23:52AM +0100, Peter Eisentraut wrote:
>> Ok, I have committed your 0001 patch.
> 
> My compiler is unhappy about this one:
> 
> ../postgresql/src/bin/pg_test_fsync/pg_test_fsync.c:605:2: error: ignoring return value of ‘write’, declared with
attributewarn_unused_result [-Werror=unused-result]
 
>    605 |  write(STDOUT_FILENO, "\n", 1);
>        |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> I think we need to do something like the following, which is similar to
> what was done in aa90e148ca7, 27314d32a88, and 6c72a28e5ce.
> 
> diff --git a/src/bin/pg_test_fsync/pg_test_fsync.c b/src/bin/pg_test_fsync/pg_test_fsync.c
> index f109aa5717..0684f4bc54 100644
> --- a/src/bin/pg_test_fsync/pg_test_fsync.c
> +++ b/src/bin/pg_test_fsync/pg_test_fsync.c
> @@ -598,11 +598,14 @@ test_non_sync(void)
>   static void
>   signal_cleanup(SIGNAL_ARGS)
>   {
> +    int         rc;
> +
>       /* Delete the file if it exists. Ignore errors */
>       if (needs_unlink)
>           unlink(filename);
>       /* Finish incomplete line on stdout */
> -    write(STDOUT_FILENO, "\n", 1);
> +    rc = write(STDOUT_FILENO, "\n", 1);
> +    (void) rc;
>       _exit(1);
>   }

Makes sense.  Can you commit that?




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: Remove MSVC scripts from the tree
Следующее
От: Nathan Bossart
Дата:
Сообщение: Re: Clean up some signal usage mainly related to Windows