]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
lstat tests: Avoid test failure on Solaris.
authorBruno Haible <bruno@clisp.org>
Fri, 13 Jun 2025 01:58:46 +0000 (03:58 +0200)
committerBruno Haible <bruno@clisp.org>
Fri, 13 Jun 2025 01:58:46 +0000 (03:58 +0200)
* tests/test-lstat.h (test_lstat_func): Reduce assumption about
/dev/null on Solaris.

ChangeLog
tests/test-lstat.h

index da241662d7d9f8b604fc113adae6e4476c245e85..797f5be68acaddde49e73af6d9c1b101f0e2c031 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2025-06-12  Bruno Haible  <bruno@clisp.org>
 
+       lstat tests: Avoid test failure on Solaris.
+       * tests/test-lstat.h (test_lstat_func): Reduce assumption about
+       /dev/null on Solaris.
+
        stat, lstat, fstat tests: Enhance tests regarding /dev/null or NUL.
        * tests/test-fstat.c: Include <fcntl.h>.
        (main): Check that fstat reports /dev/null or NUL as a character device.
index fb9a808a76efb01dd2725b8f61920847cb87e54e..bfd5b5526b28ed130fa0179917ff0f78ccbd8d4d 100644 (file)
@@ -64,14 +64,17 @@ test_lstat_func (int (*func) (char const *, struct stat *), bool print)
   ASSERT (func (BASE "file/", &st1) == -1);
   ASSERT (errno == ENOTDIR);
 
-  /* /dev/null is a character device.  */
+  /* /dev/null is a character device.
+     Except on Solaris, where it is a symlink.  */
 #if defined _WIN32 && !defined __CYGWIN__
   ASSERT (func ("NUL", &st1) == 0);
 #else
   ASSERT (func ("/dev/null", &st1) == 0);
 #endif
   ASSERT (!S_ISREG (st1.st_mode));
+#if !defined __sun
   ASSERT (S_ISCHR (st1.st_mode));
+#endif
 
   /* Now for some symlink tests, where supported.  We set up:
      link1 -> directory