From: Clément Chigot Date: Tue, 13 Jun 2023 08:51:17 +0000 (+0200) Subject: ada: Add an assert in Posix Interrupt_Wait X-Git-Tag: basepoints/gcc-15~7291 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9c70186d84b895340771fcf9df54e3ed6f1a4e48;p=thirdparty%2Fgcc.git ada: Add an assert in Posix Interrupt_Wait All functions but Interrupt_Wait in s-inmaop__posix are checking the result of their syscalls with an assert. However, any return code of sigwait different than 0 means that something went wrong for it. From sigwait man: > RETURN VALUE > On success, sigwait() returns 0. On error, it returns a > positive error number (listed in ERRORS). gcc/ada/ * libgnarl/s-inmaop__posix.adb: Add assert after sigwait in Interrupt_Wait --- diff --git a/gcc/ada/libgnarl/s-inmaop__posix.adb b/gcc/ada/libgnarl/s-inmaop__posix.adb index 3171399f982d..e4d07ee77eb4 100644 --- a/gcc/ada/libgnarl/s-inmaop__posix.adb +++ b/gcc/ada/libgnarl/s-inmaop__posix.adb @@ -135,6 +135,7 @@ package body System.Interrupt_Management.Operations is begin Result := sigwait (Mask, Sig'Access); + pragma Assert (Result = 0); if Result /= 0 then return 0;