openat, fdopendir tests: Fix link errors.
authorBruno Haible <bruno@clisp.org>
Sat, 18 Jun 2011 21:06:53 +0000 (23:06 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 18 Jun 2011 21:06:53 +0000 (23:06 +0200)
* modules/openat-tests (Depends-on): Add progname.
* modules/fdopendir-tests (Depends-on): Likewise.
* tests/test-fchownat.c: Include progname.h.
(main): Call set_program_name.
* tests/test-fstatat.c: Include progname.h.
(main): Call set_program_name.
* tests/test-mkdirat.c: Include progname.h.
(main): Call set_program_name.
* tests/test-openat.c: Include progname.h.
(main): Call set_program_name.
* tests/test-unlinkat.c: Include progname.h.
(main): Call set_program_name.
* tests/test-fdopendir.c: Include progname.h.
(main): Call set_program_name.

ChangeLog
modules/fdopendir-tests
modules/openat-tests
tests/test-fchownat.c
tests/test-fdopendir.c
tests/test-fstatat.c
tests/test-mkdirat.c
tests/test-openat.c
tests/test-unlinkat.c

index d3f084882b465f7f9c949fa173c159e257ae0fc4..ef9564b9de3b1e9b14210d58fe0786dca2be2165 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2011-06-18  Bruno Haible  <bruno@clisp.org>
+
+       openat, fdopendir tests: Fix link errors.
+       * modules/openat-tests (Depends-on): Add progname.
+       * modules/fdopendir-tests (Depends-on): Likewise.
+       * tests/test-fchownat.c: Include progname.h.
+       (main): Call set_program_name.
+       * tests/test-fstatat.c: Include progname.h.
+       (main): Call set_program_name.
+       * tests/test-mkdirat.c: Include progname.h.
+       (main): Call set_program_name.
+       * tests/test-openat.c: Include progname.h.
+       (main): Call set_program_name.
+       * tests/test-unlinkat.c: Include progname.h.
+       (main): Call set_program_name.
+       * tests/test-fdopendir.c: Include progname.h.
+       (main): Call set_program_name.
+
 2011-06-18  Bruno Haible  <bruno@clisp.org>
 
        Doc update.
index e788ff5fc5f8837c26dcf578bf19b2acc6ef0096..bee2df7df5265682c93a916c31b1202b9cb33cb0 100644 (file)
@@ -5,6 +5,7 @@ tests/macros.h
 
 Depends-on:
 open
+progname
 
 configure.ac:
 
index 250a574593509d5e56d22ac1c1ffe65bfc1d2c60..8b0a2b9e83b0ccc99d9e4750be4394b34e7263af 100644 (file)
@@ -19,6 +19,7 @@ Depends-on:
 ignore-value
 mgetgroups
 pathmax
+progname
 usleep
 stat-time
 symlink
index c09694c825d0cd4cd3113a1c248034ce011ee1f0..060013e1ed8c2f72929408efb16ed4a15e5f08ca 100644 (file)
@@ -32,6 +32,7 @@ SIGNATURE_CHECK (fchownat, int, (int, char const *, uid_t, gid_t, int));
 
 #include "mgetgroups.h"
 #include "openat.h"
+#include "progname.h"
 #include "stat-time.h"
 #include "ignore-value.h"
 #include "macros.h"
@@ -58,11 +59,13 @@ do_lchown (char const *name, uid_t user, gid_t group)
 }
 
 int
-main (void)
+main (int argc _GL_UNUSED, char *argv[])
 {
   int result1; /* Skip because of no chown/symlink support.  */
   int result2; /* Skip because of no lchown support.  */
 
+  set_program_name (argv[0]);
+
   /* Clean up any trash from prior testsuite runs.  */
   ignore_value (system ("rm -rf " BASE "*"));
 
index 81e44a13b1bd5c818ac9881fb6cd95eb696c063f..13653fe796cb3433cd7bc79e02256684bdc3da3c 100644 (file)
@@ -27,14 +27,17 @@ SIGNATURE_CHECK (fdopendir, DIR *, (int));
 #include <fcntl.h>
 #include <unistd.h>
 
+#include "progname.h"
 #include "macros.h"
 
 int
-main (void)
+main (int argc _GL_UNUSED, char *argv[])
 {
   DIR *d;
   int fd;
 
+  set_program_name (argv[0]);
+
   /* A non-directory cannot be turned into a directory stream.  */
   fd = open ("test-fdopendir.tmp", O_RDONLY | O_CREAT, 0600);
   ASSERT (0 <= fd);
index 839dad6c372001558f2aef93b4d5966063f8bae8..dda0cd224105861afe5e9092c19ef539d64482ca 100644 (file)
@@ -32,6 +32,7 @@ SIGNATURE_CHECK (fstatat, int, (int, char const *, struct stat *, int));
 
 #include "openat.h"
 #include "pathmax.h"
+#include "progname.h"
 #include "same-inode.h"
 #include "ignore-value.h"
 #include "macros.h"
@@ -58,10 +59,12 @@ do_lstat (char const *name, struct stat *st)
 }
 
 int
-main (void)
+main (int argc _GL_UNUSED, char *argv[])
 {
   int result;
 
+  set_program_name (argv[0]);
+
   /* Remove any leftovers from a previous partial run.  */
   ignore_value (system ("rm -rf " BASE "*"));
 
index 89dfafc3c7cc175b536fb1492b01a99bee8aca25..0eb5e2d491e5ba984869ba657f0d90e649a9506c 100644 (file)
@@ -30,6 +30,7 @@ SIGNATURE_CHECK (mkdirat, int, (int, char const *, mode_t));
 #include <stdlib.h>
 #include <unistd.h>
 
+#include "progname.h"
 #include "ignore-value.h"
 #include "macros.h"
 
@@ -47,10 +48,12 @@ do_mkdir (char const *name, mode_t mode)
 }
 
 int
-main (void)
+main (int argc _GL_UNUSED, char *argv[])
 {
   int result;
 
+  set_program_name (argv[0]);
+
   /* Clean up any trash from prior testsuite runs.  */
   ignore_value (system ("rm -rf " BASE "*"));
 
index fd346388090b53975be6cb66a4836d3d1cf54d41..6e6ba5b9b0977b02d5b4c2e77b4b9fb46be23d39 100644 (file)
@@ -29,6 +29,7 @@ SIGNATURE_CHECK (openat, int, (int, char const *, int, ...));
 #include <stdio.h>
 #include <unistd.h>
 
+#include "progname.h"
 #include "macros.h"
 
 #define BASE "test-openat.t"
@@ -58,10 +59,12 @@ do_open (char const *name, int flags, ...)
 }
 
 int
-main (void)
+main (int argc _GL_UNUSED, char *argv[])
 {
   int result;
 
+  set_program_name (argv[0]);
+
   /* Basic checks.  */
   result = test_open (do_open, false);
   dfd = open (".", O_RDONLY);
index f9ed249dbe157555e90294d645b3b9ccf76e2ed7..30af671a398b2c2f6797c03e35e79ad06578648c 100644 (file)
@@ -30,6 +30,7 @@ SIGNATURE_CHECK (unlinkat, int, (int, char const *, int));
 #include <stdlib.h>
 #include <sys/stat.h>
 
+#include "progname.h"
 #include "unlinkdir.h"
 #include "ignore-value.h"
 #include "macros.h"
@@ -56,12 +57,14 @@ unlinker (char const *name)
 }
 
 int
-main (void)
+main (int argc _GL_UNUSED, char *argv[])
 {
   /* FIXME: Add tests of fd other than ".".  */
   int result1;
   int result2;
 
+  set_program_name (argv[0]);
+
   /* Remove any leftovers from a previous partial run.  */
   ignore_value (system ("rm -rf " BASE "*"));