]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Add an assert in Posix Interrupt_Wait
authorClément Chigot <chigot@adacore.com>
Tue, 13 Jun 2023 08:51:17 +0000 (10:51 +0200)
committerMarc Poulhiès <poulhies@adacore.com>
Fri, 28 Jul 2023 07:28:15 +0000 (09:28 +0200)
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

gcc/ada/libgnarl/s-inmaop__posix.adb

index 3171399f982da3334c4378f825552b7344062e9c..e4d07ee77eb4807fbb840db1dd03b5b130c9c1e4 100644 (file)
@@ -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;