-/* Copyright (C) 1994-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2020 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
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <fcntl.h>
+#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
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);