From: Dagg Stompler <daggs@gmx.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v2] package/dvb-apps: fix build failure with glibc 2.31
Date: Sat, 26 Sep 2020 20:09:20 +0300 [thread overview]
Message-ID: <20200926170920.716-1-daggs@gmx.com> (raw)
dvb-apps fails to build with glibc 2.31 with the following error:
| dvbdate.c: In function set_time:
| dvbdate.c:312:6: warning: implicit declaration of function stime; did you mean ctime? [-Wimplicit-function-declaration]
| 312 | if (stime(new_time)) {
| | ^~~~~
| | ctime
Fixes:
http://autobuild.buildroot.net/results/95f30c5e6af2274418bb44a20da7caac69f1dd68/
references:
1. https://gitweb.gentoo.org/repo/gentoo.git/commit/media-tv/linuxtv-dvb-apps/files/linuxtv-dvb-apps-glibc-2.31.patch?id=eb705f892eae45b93306c1de1407c1c22ac23956
2. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=964223
Signed-off-by: Dagg Stompler <daggs@gmx.com>
---
Changes v1 -> v2:
1. fix coomit header (Thomas Petazzoni)
2. add reference to autobuilder failure (Thomas Petazzoni)
3. rework patch (Thomas Petazzoni)
4. added maintainer to CC
package/dvb-apps/0006-fix-glibc-2.31.patch | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
create mode 100644 package/dvb-apps/0006-fix-glibc-2.31.patch
diff --git a/package/dvb-apps/0006-fix-glibc-2.31.patch b/package/dvb-apps/0006-fix-glibc-2.31.patch
new file mode 100644
index 0000000000..079a24f149
--- /dev/null
+++ b/package/dvb-apps/0006-fix-glibc-2.31.patch
@@ -0,0 +1,21 @@
+dvbdate: fix compilation error with glibc 2.31
+
+as stime func doesn't exists anymore in newer versions of glibc >= 2.31 due
+to obseletion, a replacment with clock_settime is inorder to fix the issue.
+
+Signed-off-by: Dagg Stompler <daggs@gmx.com>
+
+--- a/util/dvbdate/dvbdate.c
++++ b/util/dvbdate/dvbdate.c
+@@ -309,7 +309,10 @@
+ */
+ int set_time(time_t * new_time)
+ {
+- if (stime(new_time)) {
++ struct timespec s = {0};
++ s.tv_sec = new_time;
++
++ if (clock_settime(CLOCK_REALTIME, &s)) {
+ perror("Unable to set time");
+ return -1;
+ }
--
2.28.0
next reply other threads:[~2020-09-26 17:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-26 17:09 Dagg Stompler [this message]
2020-10-15 21:12 ` [Buildroot] [PATCH v2] package/dvb-apps: fix build failure with glibc 2.31 Thomas Petazzoni
2020-10-16 20:59 ` Yann E. MORIN
2020-10-28 17:08 ` Peter Korsgaard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200926170920.716-1-daggs@gmx.com \
--to=daggs@gmx.com \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox