summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/busybox
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2019-12-21 08:31:12 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-12-30 08:47:12 +0000
commitb92a81e32a9d08d09bd902f6d8ac41a0d79996e2 (patch)
tree753dcee8e1161920ccb85a7999b28a656e2ec1e0 /meta/recipes-core/busybox
parentb8809d338005eeea4085692281dda20fe85dc52d (diff)
downloadpoky-b92a81e32a9d08d09bd902f6d8ac41a0d79996e2.tar.gz
busybox: Replace obsolete stime API with clock_settime
(From OE-Core rev: 4200e8de991d2cd98a2d0eae0b915a91d31af46f) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/busybox')
-rw-r--r--meta/recipes-core/busybox/busybox/0001-Remove-stime-function-calls.patch85
-rw-r--r--meta/recipes-core/busybox/busybox_1.31.1.bb1
2 files changed, 86 insertions, 0 deletions
diff --git a/meta/recipes-core/busybox/busybox/0001-Remove-stime-function-calls.patch b/meta/recipes-core/busybox/busybox/0001-Remove-stime-function-calls.patch
new file mode 100644
index 0000000000..9b9432844c
--- /dev/null
+++ b/meta/recipes-core/busybox/busybox/0001-Remove-stime-function-calls.patch
@@ -0,0 +1,85 @@
1From d3539be8f27b8cbfdfee460fe08299158f08bcd9 Mon Sep 17 00:00:00 2001
2From: Alistair Francis <alistair.francis@wdc.com>
3Date: Tue, 19 Nov 2019 13:06:40 +0100
4Subject: [PATCH] Remove stime() function calls
5
6stime() has been deprecated in glibc 2.31 and replaced with
7clock_settime(). Let's replace the stime() function calls with
8clock_settime() in preperation.
9
10function old new delta
11rdate_main 197 224 +27
12clock_settime - 27 +27
13date_main 926 941 +15
14stime 37 - -37
15------------------------------------------------------------------------------
16(add/remove: 2/2 grow/shrink: 2/0 up/down: 69/-37) Total: 32 bytes
17
18Upstream-Status: Backport [https://git.busybox.net/busybox/commit/?id=d3539be8f27b8cbfdfee460fe08299158f08bcd9]
19Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
20Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
21---
22 coreutils/date.c | 6 +++++-
23 libbb/missing_syscalls.c | 8 --------
24 util-linux/rdate.c | 8 ++++++--
25 3 files changed, 11 insertions(+), 11 deletions(-)
26
27--- a/coreutils/date.c
28+++ b/coreutils/date.c
29@@ -279,6 +279,9 @@ int date_main(int argc UNUSED_PARAM, cha
30 time(&ts.tv_sec);
31 #endif
32 }
33+#if !ENABLE_FEATURE_DATE_NANO
34+ ts.tv_nsec = 0;
35+#endif
36 localtime_r(&ts.tv_sec, &tm_time);
37
38 /* If date string is given, update tm_time, and maybe set date */
39@@ -301,9 +304,10 @@ int date_main(int argc UNUSED_PARAM, cha
40 if (date_str[0] != '@')
41 tm_time.tm_isdst = -1;
42 ts.tv_sec = validate_tm_time(date_str, &tm_time);
43+ ts.tv_nsec = 0;
44
45 /* if setting time, set it */
46- if ((opt & OPT_SET) && stime(&ts.tv_sec) < 0) {
47+ if ((opt & OPT_SET) && clock_settime(CLOCK_REALTIME, &ts) < 0) {
48 bb_perror_msg("can't set date");
49 }
50 }
51--- a/libbb/missing_syscalls.c
52+++ b/libbb/missing_syscalls.c
53@@ -15,14 +15,6 @@ pid_t getsid(pid_t pid)
54 return syscall(__NR_getsid, pid);
55 }
56
57-int stime(const time_t *t)
58-{
59- struct timeval tv;
60- tv.tv_sec = *t;
61- tv.tv_usec = 0;
62- return settimeofday(&tv, NULL);
63-}
64-
65 int sethostname(const char *name, size_t len)
66 {
67 return syscall(__NR_sethostname, name, len);
68--- a/util-linux/rdate.c
69+++ b/util-linux/rdate.c
70@@ -95,9 +95,13 @@ int rdate_main(int argc UNUSED_PARAM, ch
71 if (!(flags & 2)) { /* no -p (-s may be present) */
72 if (time(NULL) == remote_time)
73 bb_error_msg("current time matches remote time");
74- else
75- if (stime(&remote_time) < 0)
76+ else {
77+ struct timespec ts;
78+ ts.tv_sec = remote_time;
79+ ts.tv_nsec = 0;
80+ if (clock_settime(CLOCK_REALTIME, &ts) < 0)
81 bb_perror_msg_and_die("can't set time of day");
82+ }
83 }
84
85 if (flags != 1) /* not lone -s */
diff --git a/meta/recipes-core/busybox/busybox_1.31.1.bb b/meta/recipes-core/busybox/busybox_1.31.1.bb
index e7618e5bfe..1d0102eb2b 100644
--- a/meta/recipes-core/busybox/busybox_1.31.1.bb
+++ b/meta/recipes-core/busybox/busybox_1.31.1.bb
@@ -42,6 +42,7 @@ SRC_URI = "https://busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \
42 file://0001-testsuite-check-uudecode-before-using-it.patch \ 42 file://0001-testsuite-check-uudecode-before-using-it.patch \
43 file://0001-testsuite-use-www.example.org-for-wget-test-cases.patch \ 43 file://0001-testsuite-use-www.example.org-for-wget-test-cases.patch \
44 file://0001-du-l-works-fix-to-use-145-instead-of-144.patch \ 44 file://0001-du-l-works-fix-to-use-145-instead-of-144.patch \
45 file://0001-Remove-stime-function-calls.patch \
45" 46"
46SRC_URI_append_libc-musl = " file://musl.cfg " 47SRC_URI_append_libc-musl = " file://musl.cfg "
47 48