]> granicus.if.org Git - strace/commitdiff
tests/rt_sigqueueinfo.c: use libtests
authorDmitry V. Levin <ldv@altlinux.org>
Mon, 4 Jan 2016 23:49:32 +0000 (23:49 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Wed, 6 Jan 2016 00:14:36 +0000 (00:14 +0000)
* tests/rt_sigqueueinfo.c (main): Use assert and perror_msg_and_skip.

tests/rt_sigqueueinfo.c

index be277a438fbf0fdaa672f533df62c7e869010862..9ca860adf73b1f138a36655db41822b7ffa11f5a 100644 (file)
@@ -25,6 +25,8 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include "tests.h"
+#include <assert.h>
 #include <stdio.h>
 #include <signal.h>
 #include <unistd.h>
@@ -40,10 +42,9 @@ main (void)
        };
        pid_t pid = getpid();
 
-       if (sigaction(SIGUSR1, &sa, NULL) == -1)
-               return 77;
-       if (sigqueue(pid, SIGUSR1, value) == -1)
-               return 77;
+       assert(sigaction(SIGUSR1, &sa, NULL) == 0);
+       if (sigqueue(pid, SIGUSR1, value))
+               perror_msg_and_skip("sigqueue");
        printf("rt_sigqueueinfo(%u, SIGUSR1, {si_signo=SIGUSR1, "
                "si_code=SI_QUEUE, si_pid=%u, si_uid=%u, "
                "si_value={int=%d, ptr=%p}}) = 0\n",