+2024-08-12 Bruno Haible <bruno@clisp.org>
+
+ fdutimensat, utimensat tests: Fix test failures on Cygwin.
+ * tests/nap.h: Include concat-filename.h, xgetcwd.h.
+ (nap_file): New variable.
+ (nap_get_stat, clear_temp_file): Use nap_file, not TEMPFILE.
+ (nap): Initialize nap_file.
+ * modules/chown-tests (Depends-on): Add xconcat-filename, xgetcwd.
+ * modules/fchownat-tests (Depends-on): Likewise.
+ * modules/fdutimensat-tests (Depends-on): Likewise.
+ * modules/futimens-tests (Depends-on): Likewise.
+ * modules/lchown-tests (Depends-on): Likewise.
+ * modules/stat-time-tests (Depends-on): Likewise.
+ * modules/utime-tests (Depends-on): Likewise.
+ * modules/utimens-tests (Depends-on): Likewise.
+ * modules/utimensat-tests (Depends-on): Likewise.
+
2024-08-10 Bruno Haible <bruno@clisp.org>
Make sure gperf-generated files are the same in VPATH builds.
# define GLTEST_NAP_H
# include <limits.h>
-
# include <stdckdint.h>
+# include "concat-filename.h"
+# include "xgetcwd.h"
+
/* Avoid a conflict with a function called nap() on UnixWare. */
# if defined _SCO_DS || (defined __SCO_VERSION__ || defined __sysv5__) /* OpenServer, UnixWare */
# include <unistd.h>
/* Name of the witness file. */
#define TEMPFILE BASE "nap.tmp"
+/* Absolute name of the witness file. */
+static char *nap_file /* = NULL */;
+
/* File descriptor used for the witness file. */
static int nap_fd = -1;
is closed. See
<https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-writefile> */
close (nap_fd);
- nap_fd = open (TEMPFILE, O_RDWR, 0600);
+ nap_fd = open (nap_file, O_RDWR, 0600);
ASSERT (nap_fd != -1);
lseek (nap_fd, 0, SEEK_END);
#endif
if (0 <= nap_fd)
{
ASSERT (close (nap_fd) != -1);
- ASSERT (unlink (TEMPFILE) != -1);
+ ASSERT (unlink (nap_file) != -1);
}
}
if (-1 == nap_fd)
{
+ nap_file = xconcatenated_filename (xgetcwd (), TEMPFILE, NULL);
atexit (clear_temp_file);
- ASSERT ((nap_fd = creat (TEMPFILE, 0600)) != -1);
+ ASSERT ((nap_fd = creat (nap_file, 0600)) != -1);
nap_get_stat (&old_st, 0);
}
else