From: Masafumi UTSUGI <muts...@allied-telesis.co.jp> SYS_settimeofday syscall is not time64 safe. Using settimeofday() instead of syscall() is recommended or some C libraries such as musl might cause compile error.
Signed-off-by: Masafumi UTSUGI <muts...@allied-telesis.co.jp> --- Makefile | 2 +- patches/250-date-k-flag.patch | 26 +++++++++++--------------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index 01441d1..baf375e 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=busybox PKG_VERSION:=1.31.1 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_FLAGS:=essential PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 diff --git a/patches/250-date-k-flag.patch b/patches/250-date-k-flag.patch index 5aadbb2..ef0545c 100644 --- a/patches/250-date-k-flag.patch +++ b/patches/250-date-k-flag.patch @@ -8,19 +8,15 @@ //usage: "\n" //usage: "\nRecognized TIME formats:" //usage: "\n hh:mm[:ss]" -@@ -139,9 +140,8 @@ - - #include "libbb.h" - #include "common_bufsiz.h" --#if ENABLE_FEATURE_DATE_NANO --# include <sys/syscall.h> --#endif +@@ -142,6 +143,7 @@ + #if ENABLE_FEATURE_DATE_NANO + # include <sys/syscall.h> + #endif +#include <sys/time.h> -+#include <sys/syscall.h> enum { OPT_RFC2822 = (1 << 0), /* R */ -@@ -149,8 +149,9 @@ enum { +@@ -149,8 +151,9 @@ enum { OPT_UTC = (1 << 2), /* u */ OPT_DATE = (1 << 3), /* d */ OPT_REFERENCE = (1 << 4), /* r */ @@ -32,7 +28,7 @@ }; #if ENABLE_LONG_OPTS -@@ -162,6 +163,7 @@ static const char date_longopts[] ALIGN1 +@@ -162,6 +165,7 @@ static const char date_longopts[] ALIGN1 = /* "universal\0" No_argument "u" */ "date\0" Required_argument "d" "reference\0" Required_argument "r" @@ -40,7 +36,7 @@ ; #endif -@@ -181,6 +183,8 @@ static void maybe_set_utc(int opt) +@@ -181,6 +185,8 @@ static void maybe_set_utc(int opt) int date_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; int date_main(int argc UNUSED_PARAM, char **argv) { @@ -49,7 +45,7 @@ struct timespec ts; struct tm tm_time; char buf_fmt_dt2str[64]; -@@ -193,7 +197,7 @@ int date_main(int argc UNUSED_PARAM, cha +@@ -193,7 +199,7 @@ int date_main(int argc UNUSED_PARAM, char **argv) char *isofmt_arg = NULL; opt = getopt32long(argv, "^" @@ -58,7 +54,7 @@ IF_FEATURE_DATE_ISOFMT("I::D:") "\0" "d--s:s--d" -@@ -256,6 +260,31 @@ int date_main(int argc UNUSED_PARAM, cha +@@ -256,6 +262,31 @@ int date_main(int argc UNUSED_PARAM, char **argv) if (*argv) bb_show_usage(); @@ -69,7 +65,7 @@ + + /* workaround warp_clock() on first invocation */ + memset(&tz, 0, sizeof(tz)); -+ syscall(SYS_settimeofday, NULL, &tz); ++ settimeofday(NULL, &tz); + + memset(&tz, 0, sizeof(tz)); +#ifdef __USE_MISC @@ -78,7 +74,7 @@ + tz.tz_minuteswest = -(tm_time.__tm_gmtoff / 60); +#endif + -+ if (syscall(SYS_settimeofday, NULL, &tz)) ++ if (settimeofday(NULL, &tz)) + { + bb_perror_msg("can't set kernel time zone"); + return EXIT_FAILURE; -- 2.7.4 _______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel