/* Test of lstat() function.
- Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+ Copyright (C) 2008-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include <sys/stat.h>
+/* Caution: lstat may be a function-like macro. Although this
+ signature check must pass, it may be the signature of the real (and
+ broken) lstat rather than rpl_lstat. Most code should not use the
+ address of lstat. */
+#include "signature.h"
+SIGNATURE_CHECK (lstat, int, (char const *, struct stat *));
+
#include <fcntl.h>
#include <errno.h>
#include <stdbool.h>
#include <unistd.h>
#include "same-inode.h"
-
-#if !HAVE_SYMLINK
-# define symlink(a,b) (-1)
-#endif
-
-#define ASSERT(expr) \
- do \
- { \
- if (!(expr)) \
- { \
- fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
- fflush (stderr); \
- abort (); \
- } \
- } \
- while (0)
+#include "ignore-value.h"
+#include "macros.h"
#define BASE "test-lstat.t"
}
int
-main ()
+main (void)
{
+ /* Remove any leftovers from a previous partial run. */
+ ignore_value (system ("rm -rf " BASE "*"));
+
return test_lstat_func (do_lstat, true);
}