summaryrefslogtreecommitdiff
path: root/busybox-1.31.1-stime-fix.patch
blob: 15af3271520b730d23a5d7103d60ebc3c819df64 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
diff -up busybox-1.31.1/libbb/Kbuild.src.stime busybox-1.31.1/libbb/Kbuild.src
--- busybox-1.31.1/libbb/Kbuild.src.stime	2019-11-13 17:08:22.808371597 -0500
+++ busybox-1.31.1/libbb/Kbuild.src	2019-11-13 17:08:50.154882529 -0500
@@ -198,3 +198,6 @@ lib-$(CONFIG_FEATURE_FIND_REGEX) += xreg
 
 # Add the experimental logging functionality, only used by zcip
 lib-$(CONFIG_ZCIP) += logenv.o
+
+lib-$(CONFIG_DATE) += stime.o
+lib-$(CONFIG_RDATE) += stime.o
diff -up busybox-1.31.1/libbb/stime.c.stime busybox-1.31.1/libbb/stime.c
--- busybox-1.31.1/libbb/stime.c.stime	2019-11-13 17:07:06.905723262 -0500
+++ busybox-1.31.1/libbb/stime.c	2019-11-13 17:07:51.769924328 -0500
@@ -0,0 +1,10 @@
+#include <time.h>
+#include <sys/time.h>
+
+int stime(const time_t *t) {
+  struct timeval tv;
+
+  tv.tv_sec = *t;
+  tv.tv_usec = 0;
+  return settimeofday(&tv, NULL);
+}