Ticket #19214: fu.c

File fu.c, 533 bytes (added by bhaible, 40 hours ago)

test case fu.c

Line 
1#include <sys/stat.h>
2#include <fcntl.h>
3#include <time.h>
4#include <sys/time.h>
5#include <stdio.h>
6#include <unistd.h>
7
8int main ()
9{
10 for (int i = 0; i < 10; i++) {
11 char buf[100];
12 sprintf (buf, "dummy%d", i);
13
14 int fd = open (buf, O_CREAT|O_RDWR, 0644);
15 if (fd < 0)
16 perror ("open");
17
18 close (fd);
19
20 struct timeval tv[2] = {
21 { .tv_sec = 1730303310, .tv_usec = 0 },
22 { .tv_sec = 1730303310, .tv_usec = 0 },
23 };
24 int ret = utimes (buf, tv);
25 if (ret < 0)
26 perror ("utimes");
27 }
28}