[openwrt/openwrt] busybox: use CLOCK_MONOTONIC instead of gettimeofday

LEDE Commits lede-commits at lists.infradead.org
Sat Jul 11 09:54:37 EDT 2020


ynezz pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/c5c652e5ad97335eb3968dab6be0d7152e22893b

commit c5c652e5ad97335eb3968dab6be0d7152e22893b
Author: Rui Salvaterra <rsalvaterra at gmail.com>
AuthorDate: Wed Jul 8 09:18:14 2020 +0100

    busybox: use CLOCK_MONOTONIC instead of gettimeofday
    
    The clock_gettime(CLOCK_MONOTONIC) syscall exists for so long that the first
    kernel version to support it is not even specified in the man page [1]. Let's
    enable it on BusyBox by default. Otherwise, gettimeofday will be used instead,
    which will give wrong results if the date/time is reset (time moving backwards).
    
    [1] https://linux.die.net/man/2/clock_gettime
    
    Signed-off-by: Rui Salvaterra <rsalvaterra at gmail.com>
---
 package/utils/busybox/Config-defaults.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/utils/busybox/Config-defaults.in b/package/utils/busybox/Config-defaults.in
index 91c9b9b5b9..89da7ace8d 100644
--- a/package/utils/busybox/Config-defaults.in
+++ b/package/utils/busybox/Config-defaults.in
@@ -303,7 +303,7 @@ config BUSYBOX_DEFAULT_FEATURE_SKIP_ROOTFS
 	default n
 config BUSYBOX_DEFAULT_MONOTONIC_SYSCALL
 	bool
-	default n
+	default y
 config BUSYBOX_DEFAULT_IOCTL_HEX2STR_ERROR
 	bool
 	default y



More information about the lede-commits mailing list