From patchwork Sat Dec 21 16:31:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 182360 Delivered-To: patch@linaro.org Received: by 2002:a92:1f98:0:0:0:0:0 with SMTP id f24csp1984080ilf; Sat, 21 Dec 2019 08:31:37 -0800 (PST) X-Google-Smtp-Source: APXvYqzKb+z36/J8A5O695rb6o5f+c9LabaYhk3xC6rOi2+RHfdMdCwI8NBOkZYbhmHmgEpnuhVj X-Received: by 2002:a63:dd58:: with SMTP id g24mr21128896pgj.102.1576945896859; Sat, 21 Dec 2019 08:31:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576945896; cv=none; d=google.com; s=arc-20160816; b=UQAXPFrF9MKNDFAQPTNxt7Ra7TTvyzxpIXh99kQGjd75pBrljGSs6PCFC65gPEFJlW xadKctSCVzDo0O9CCOg6MjfSfWIQT2YP4CKLu6V2RrrSkDb7y+yDHrZDV5SDx7+H+25D ZF8zEEurM/ScB2fslUHSOa7gKgXH1PCc7r75aiJNEIcHCEVheuuECaeEh92xr9ihGYVz tCOpCFI6o8HKgGDV3cw+yr5wHrTK0SG2vjbY9/Dd/HiGs2vAoWQraHPIWIztHCrdKtS3 raz6MTguUb1/nqUG34yFnNB4+FEvaBY2ntg+ZxqUvE8VZdLlMPePoNvccHS2WmGneNqV NCbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:message-id:date:to:from:dkim-signature:delivered-to; bh=sjOgeM/e1EFFhWcA0TIGrmsMqFIA/W5ZpghqItDiAO4=; b=j/c2cLQaVQ6vq/nxXqZXXtNWhRwAaK5Y/oGDqamkk9h53R2HDEc55tgpwfyrJy0y3u f+V15iPQkLCnQgJk9ftbWzjVSayt9Vh7LKECHmkIKqBhkVB2voIp0VzlIJxJIhy6vbCV ZdyOXk0ebsM0v7hD70iV3bEWhU0AvpRFTa7kp+ifIswij3S96D9id926YkXaFNsgzDPO nqGM3R00ALKmrtHqEZeq58l7cLEDlkOye7dqXfCamD4qg+2rKFKwDzV+OTzWgREEt0O5 xOaONx1k67iF4eTy5hMkG46LpXXqFm9kgrFZJyTidarpPpzWFMYtzLdRDLDfyc03+45w qk7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=mZXJzhUw; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id c19si12344337plo.395.2019.12.21.08.31.35; Sat, 21 Dec 2019 08:31:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=mZXJzhUw; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from ec2-34-214-78-129.us-west-2.compute.amazonaws.com (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id D74EF6C109; Sat, 21 Dec 2019 16:31:27 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) by mail.openembedded.org (Postfix) with ESMTP id E460A7F695 for ; Sat, 21 Dec 2019 16:31:25 +0000 (UTC) Received: by mail-pl1-f175.google.com with SMTP id g6so2482131plp.6 for ; Sat, 21 Dec 2019 08:31:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=AJfHUZxlt99tk0Wa9n4O/xUwBOEqsVF72T2IanVs21g=; b=mZXJzhUwhEh0vPz1PFNrp9DQADWJbMAZg42GepFB3vc4xa7gCdGV5ml3PjlHgu8ful F3w5R4P6kvz1WgQAPFcgyH/wNw3xlDnGA5nh52/vVT23q7e/b3ngN8t98G6dQYu0QMxr ZqsnWwz7ECbkaE6K49CZ+i7QvQ/AwM4wZ6liFQoGDBU9aIYR2F+oq79GLJBJ8jh4gxJ2 GP70uItjvCRE5hy09fYeCAlI3dZtdww/WqFOnVGKLTxi5Qdu04CxIrmnSOztttXx0Rak 7MkDVkBCNzQusZS1l9Qzz0XwfTRPxCEuIS7wkq+HE2TwLNR9S37SOasvYMHj+zNxjbna Ecsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=AJfHUZxlt99tk0Wa9n4O/xUwBOEqsVF72T2IanVs21g=; b=n975Y5Spw1jhB8oiHOvO/8Ktf1jdrO8bl7UsXZxSeQYnGTWDXvHP6pQbiGMsosWrG6 njIpgvp0RHmEYcq1AtBFySMfXbYb3MDbaf6lBSDOCUSYcicDYOPTexXsE5nTfW+oXVXf lPHJuX3wmc7+4x9y0HEvRPI1SvwZfAZUwp3z7JQxSgLUsm89+0P/gJgfeeAtKUFG8rfe UbRKYffEmwywmnH/Sf5+eZgH0mJAtKpXVgSdkYeZfpYaBnb/U27WSZWVPyybbRtYSPjz ahrP7dORrRoZrRGKkGlJaocuRCCumOrhIXl7AKvxhbV/+co9nDw+aKG9FFCPhGMPVKyg bCuA== X-Gm-Message-State: APjAAAVB2WLn4PEsyT3SkCu3zO6XfcXlxh+DO9hHMV0eeqRNVNxEs19F QeyfbGakZbyVkdmlCCehv9ZjGOREpQI= X-Received: by 2002:a17:902:8f85:: with SMTP id z5mr21814077plo.43.1576945885579; Sat, 21 Dec 2019 08:31:25 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9200:4e0::36e9]) by smtp.gmail.com with ESMTPSA id h16sm17821331pfn.85.2019.12.21.08.31.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Dec 2019 08:31:25 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Date: Sat, 21 Dec 2019 08:31:12 -0800 Message-Id: <20191221163112.2481556-1-raj.khem@gmail.com> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Subject: [OE-core] [PATCH] busybox: Replace obsolete stime API with clock_settime X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org Signed-off-by: Khem Raj --- .../0001-Remove-stime-function-calls.patch | 85 +++++++++++++++++++ meta/recipes-core/busybox/busybox_1.31.1.bb | 1 + 2 files changed, 86 insertions(+) create mode 100644 meta/recipes-core/busybox/busybox/0001-Remove-stime-function-calls.patch -- 2.24.1 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core 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 @@ +From d3539be8f27b8cbfdfee460fe08299158f08bcd9 Mon Sep 17 00:00:00 2001 +From: Alistair Francis +Date: Tue, 19 Nov 2019 13:06:40 +0100 +Subject: [PATCH] Remove stime() function calls + +stime() has been deprecated in glibc 2.31 and replaced with +clock_settime(). Let's replace the stime() function calls with +clock_settime() in preperation. + +function old new delta +rdate_main 197 224 +27 +clock_settime - 27 +27 +date_main 926 941 +15 +stime 37 - -37 +------------------------------------------------------------------------------ +(add/remove: 2/2 grow/shrink: 2/0 up/down: 69/-37) Total: 32 bytes + +Upstream-Status: Backport [https://git.busybox.net/busybox/commit/?id=d3539be8f27b8cbfdfee460fe08299158f08bcd9] +Signed-off-by: Alistair Francis +Signed-off-by: Denys Vlasenko +--- + coreutils/date.c | 6 +++++- + libbb/missing_syscalls.c | 8 -------- + util-linux/rdate.c | 8 ++++++-- + 3 files changed, 11 insertions(+), 11 deletions(-) + +--- a/coreutils/date.c ++++ b/coreutils/date.c +@@ -279,6 +279,9 @@ int date_main(int argc UNUSED_PARAM, cha + time(&ts.tv_sec); + #endif + } ++#if !ENABLE_FEATURE_DATE_NANO ++ ts.tv_nsec = 0; ++#endif + localtime_r(&ts.tv_sec, &tm_time); + + /* If date string is given, update tm_time, and maybe set date */ +@@ -301,9 +304,10 @@ int date_main(int argc UNUSED_PARAM, cha + if (date_str[0] != '@') + tm_time.tm_isdst = -1; + ts.tv_sec = validate_tm_time(date_str, &tm_time); ++ ts.tv_nsec = 0; + + /* if setting time, set it */ +- if ((opt & OPT_SET) && stime(&ts.tv_sec) < 0) { ++ if ((opt & OPT_SET) && clock_settime(CLOCK_REALTIME, &ts) < 0) { + bb_perror_msg("can't set date"); + } + } +--- a/libbb/missing_syscalls.c ++++ b/libbb/missing_syscalls.c +@@ -15,14 +15,6 @@ pid_t getsid(pid_t pid) + return syscall(__NR_getsid, pid); + } + +-int stime(const time_t *t) +-{ +- struct timeval tv; +- tv.tv_sec = *t; +- tv.tv_usec = 0; +- return settimeofday(&tv, NULL); +-} +- + int sethostname(const char *name, size_t len) + { + return syscall(__NR_sethostname, name, len); +--- a/util-linux/rdate.c ++++ b/util-linux/rdate.c +@@ -95,9 +95,13 @@ int rdate_main(int argc UNUSED_PARAM, ch + if (!(flags & 2)) { /* no -p (-s may be present) */ + if (time(NULL) == remote_time) + bb_error_msg("current time matches remote time"); +- else +- if (stime(&remote_time) < 0) ++ else { ++ struct timespec ts; ++ ts.tv_sec = remote_time; ++ ts.tv_nsec = 0; ++ if (clock_settime(CLOCK_REALTIME, &ts) < 0) + bb_perror_msg_and_die("can't set time of day"); ++ } + } + + 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 \ file://0001-testsuite-check-uudecode-before-using-it.patch \ file://0001-testsuite-use-www.example.org-for-wget-test-cases.patch \ file://0001-du-l-works-fix-to-use-145-instead-of-144.patch \ + file://0001-Remove-stime-function-calls.patch \ " SRC_URI_append_libc-musl = " file://musl.cfg "