| OLD | NEW |
| 1 #define _GNU_SOURCE | 1 #define _GNU_SOURCE |
| 2 #include <sys/time.h> | 2 #include <sys/time.h> |
| 3 #include <sys/stat.h> | 3 #include <sys/stat.h> |
| 4 #include <errno.h> | 4 #include <errno.h> |
| 5 #include "syscall.h" | 5 #include "syscall.h" |
| 6 #include "libc.h" | 6 #include "libc.h" |
| 7 | 7 |
| 8 int __futimesat(int dirfd, const char *pathname, const struct timeval times[2]) | 8 int __futimesat(int dirfd, |
| 9 { | 9 const char* pathname, |
| 10 » struct timespec ts[2]; | 10 const struct timeval times[2]) { |
| 11 » if (times) { | 11 struct timespec ts[2]; |
| 12 » » int i; | 12 if (times) { |
| 13 » » for (i=0; i<2; i++) { | 13 int i; |
| 14 » » » if (times[i].tv_usec >= 1000000ULL) | 14 for (i = 0; i < 2; i++) { |
| 15 » » » » return __syscall_ret(-EINVAL); | 15 if (times[i].tv_usec >= 1000000ULL) |
| 16 » » » ts[i].tv_sec = times[i].tv_sec; | 16 return __syscall_ret(-EINVAL); |
| 17 » » » ts[i].tv_nsec = times[i].tv_usec * 1000; | 17 ts[i].tv_sec = times[i].tv_sec; |
| 18 » » } | 18 ts[i].tv_nsec = times[i].tv_usec * 1000; |
| 19 » } | 19 } |
| 20 » return utimensat(dirfd, pathname, times ? ts : 0, 0); | 20 } |
| 21 return utimensat(dirfd, pathname, times ? ts : 0, 0); |
| 21 } | 22 } |
| 22 | 23 |
| 23 weak_alias(__futimesat, futimesat); | 24 weak_alias(__futimesat, futimesat); |
| OLD | NEW |