mirror of
https://gitlab.redox-os.org/redox-os/redox.git
synced 2026-06-22 21:04:18 +08:00
35 lines
1.1 KiB
Diff
35 lines
1.1 KiB
Diff
diff '--color=auto' -ruwN source/programs/util.h source-new/programs/util.h
|
|
--- source/programs/util.h 2024-07-21 13:29:49.000000000 -0400
|
|
+++ source-new/programs/util.h 2024-12-13 02:21:03.032769559 -0500
|
|
@@ -52,6 +52,9 @@
|
|
#include <time.h> /* time */
|
|
#include <limits.h> /* INT_MAX */
|
|
#include <errno.h>
|
|
+#if defined(_REDOX)
|
|
+# include <sys/time.h> /* utimes */
|
|
+#endif
|
|
|
|
|
|
|
|
@@ -239,12 +242,20 @@
|
|
timebuf.modtime = statbuf->st_mtime;
|
|
res += utime(filename, &timebuf); /* set access and modification times */
|
|
#else
|
|
+ #if defined(_REDOX)
|
|
+ struct timeval timebuf[2];
|
|
+ memset(timebuf, 0, sizeof(timebuf));
|
|
+ timebuf[0].tv_usec = UTIME_NOW;
|
|
+ timebuf[1].tv_sec = statbuf->st_mtime;
|
|
+ res += utimes(filename, timebuf);
|
|
+ #else
|
|
struct timespec timebuf[2];
|
|
memset(timebuf, 0, sizeof(timebuf));
|
|
timebuf[0].tv_nsec = UTIME_NOW;
|
|
timebuf[1].tv_sec = statbuf->st_mtime;
|
|
res += utimensat(AT_FDCWD, filename, timebuf, 0); /* set access and modification times */
|
|
#endif
|
|
+#endif
|
|
}
|
|
|
|
#if !defined(_WIN32)
|