+2010-10-04 Bruno Haible <bruno@clisp.org>
+
+ read-file tests: Avoid a test failure on NonStop Kernel.
+ * tests/test-read-file.c (main): Don't assume that /etc/resolv.conf is
+ a regular file.
+ Reported by Joachim Schmitz <schmitz@hp.com>.
+
2010-10-03 Bruno Haible <bruno@clisp.org>
gnulib-tool: Fixes for --create-testdir with --libtool.
err = 1;
}
- /* Assume FILE1 is a regular file or a symlink to a regular file. */
- if (len != statbuf.st_size)
+ if (S_ISREG (statbuf.st_mode))
{
- fprintf (stderr, "Read %ld from %s...\n", (unsigned long) len, FILE1);
- err = 1;
+ /* FILE1 is a regular file or a symlink to a regular file. */
+ if (len != statbuf.st_size)
+ {
+ fprintf (stderr, "Read %ld from %s...\n", (unsigned long) len, FILE1);
+ err = 1;
+ }
+ }
+ else
+ {
+ /* Assume FILE1 is not empty. */
+ if (len == 0)
+ {
+ fprintf (stderr, "Read nothing from %s\n", FILE1);
+ err = 1;
+ }
}
free (out);
}