S390: Fix building with --disable-mutli-arch [BZ #31196]
[platform/upstream/glibc.git] / rt / tst-mqueue2.c
index 18fadfe..5a2a3bf 100644 (file)
@@ -1,5 +1,5 @@
 /* Test message queue passing.
-   Copyright (C) 2004-2022 Free Software Foundation, Inc.
+   Copyright (C) 2004-2024 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -27,6 +27,7 @@
 #include <sys/wait.h>
 #include <time.h>
 #include <unistd.h>
+#include <support/check.h>
 #include "tst-mqueue.h"
 
 static void
@@ -48,11 +49,14 @@ do_test (void)
 
   if (q == (mqd_t) -1)
     {
+      if (errno == ENOSYS)
+       FAIL_UNSUPPORTED ("mq_open not supported");
+
       printf ("mq_open failed with: %m\n");
-      return result;
+      return 1;
     }
-  else
-    add_temp_mq (name);
+
+  add_temp_mq (name);
 
   mqd_t q2 = mq_open (name, O_CREAT | O_EXCL | O_RDWR, 0600, &attr);
   if (q2 != (mqd_t) -1)
@@ -459,12 +463,12 @@ do_test (void)
 
   if (mq_unlink ("/tst-mqueue2-which-should-never-exist") != -1)
     {
-      puts ("mq_unlink of non-existant message queue unexpectedly succeeded");
+      puts ("mq_unlink of non-existent message queue unexpectedly succeeded");
       result = 1;
     }
   else if (errno != ENOENT)
     {
-      printf ("mq_unlink of non-existant message queue did not fail with "
+      printf ("mq_unlink of non-existent message queue did not fail with "
              "ENOENT: %m\n");
       result = 1;
     }