summaryrefslogtreecommitdiff
path: root/io/test-utime.c
diff options
context:
space:
mode:
Diffstat (limited to 'io/test-utime.c')
-rw-r--r--io/test-utime.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/io/test-utime.c b/io/test-utime.c
index d8d2390757..0ab778e374 100644
--- a/io/test-utime.c
+++ b/io/test-utime.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -16,6 +16,7 @@
<http://www.gnu.org/licenses/>. */
#include <fcntl.h>
+#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
@@ -26,23 +27,17 @@
int
main (int argc, char *argv[])
{
- char file[L_tmpnam];
+ char file[] = "/tmp/test-utime.XXXXXX";
struct utimbuf ut;
struct stat st;
struct stat stnow;
time_t now1, now2;
int fd;
- if (tmpnam (file) == 0)
- {
- perror ("tmpnam");
- return 1;
- }
-
- fd = creat (file, 0666);
+ fd = mkstemp (file);
if (fd < 0)
{
- perror ("creat");
+ perror ("mkstemp");
return 1;
}
close (fd);