]> Savannah Git Hosting - gnulib.git/commitdiff
linkat-tests: fix up assertion-failure changes
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 20 May 2024 16:54:26 +0000 (09:54 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 20 May 2024 16:54:46 +0000 (09:54 -0700)
* tests/test-linkat.c (main): Don’t lose the failure results of
earlier tests.  Problem found by Coverity.

ChangeLog
tests/test-linkat.c

index 997f51f3b5efcc3e45ed7fb813b348bc18bd8685..ea799492a1b9845db4726c147f68d57c14150fe7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2024-05-20  Paul Eggert  <eggert@cs.ucla.edu>
 
+       linkat-tests: fix up assertion-failure changes
+       * tests/test-linkat.c (main): Don’t lose the failure results of
+       earlier tests.  Problem found by Coverity.
+
        dfa: attempt to pacify Coverity
        * lib/dfa.c (lex): Use ‘assume’ rather than ‘abort’,
        to try to pacify Coverity.
index c3efb5df60b7a2e8d29371d1e350f3aa8a09a28a..04814ddd1bde28fd5f580646495ae69093faad1f 100644 (file)
@@ -141,7 +141,7 @@ main (void)
   /* Skip the rest of the test if the file system does not support hard links
      and symlinks.  */
   if (result)
-    return result;
+    return test_exit_status ? test_exit_status : result;
 
   /* Create locations to manipulate.  */
   ASSERT (mkdir (BASE "sub1", 0700) == 0);
@@ -202,10 +202,13 @@ main (void)
       ASSERT (rmdir (BASE "sub1") == 0);
       ASSERT (rmdir (BASE "sub2") == 0);
       free (cwd);
-      if (!result)
-        fputs ("skipping test: symlinks not supported on this file system\n",
-               stderr);
-      return result;
+      if (!test_exit_status)
+        {
+          fputs ("skipping test: symlinks not supported on this file system\n",
+                 stderr);
+          return 77;
+        }
+      return test_exit_status;
     }
   dfd = open (".", O_RDONLY);
   ASSERT (0 <= dfd);
@@ -384,5 +387,5 @@ main (void)
   ASSERT (unlink (BASE "link5") == 0);
   free (cwd);
 
-  return (result ? result : test_exit_status);
+  return test_exit_status;
 }