vanhofen
2 years ago
8 changed files with 76 additions and 25 deletions
@ -0,0 +1,35 @@ |
|||||
|
From d6817dbaf407f65dd4af12c51736153fae8b217f Mon Sep 17 00:00:00 2001 |
||||
|
From: Khem Raj <raj.khem@gmail.com> |
||||
|
Date: Sat, 21 Dec 2019 08:36:11 -0800 |
||||
|
Subject: [PATCH] dvbdate: Remove Obsoleted stime API calls |
||||
|
|
||||
|
stime() has been deprecated in glibc 2.31+ its recommended to |
||||
|
replaced with clock_settime() |
||||
|
|
||||
|
Signed-off-by: Khem Raj <raj.khem@gmail.com> |
||||
|
---
|
||||
|
util/dvbdate/dvbdate.c | 5 ++++- |
||||
|
1 file changed, 4 insertions(+), 1 deletion(-) |
||||
|
|
||||
|
diff --git a/util/dvbdate/dvbdate.c b/util/dvbdate/dvbdate.c
|
||||
|
index f0df437..492ed79 100644
|
||||
|
--- a/util/dvbdate/dvbdate.c
|
||||
|
+++ b/util/dvbdate/dvbdate.c
|
||||
|
@@ -309,7 +309,14 @@
|
||||
|
*/ |
||||
|
int set_time(time_t * new_time) |
||||
|
{ |
||||
|
+#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 31)
|
||||
|
+ struct timespec s = {0};
|
||||
|
+ s.tv_sec = new_time;
|
||||
|
+
|
||||
|
+ if (clock_settime(CLOCK_REALTIME, &s)) {
|
||||
|
+#else
|
||||
|
if (stime(new_time)) { |
||||
|
+#endif
|
||||
|
perror("Unable to set time"); |
||||
|
return -1; |
||||
|
} |
||||
|
--
|
||||
|
2.24.1 |
||||
|
|
@ -0,0 +1,13 @@ |
|||||
|
diff -r 3d43b280298c lib/libucsi/endianops.h
|
||||
|
--- a/lib/libucsi/endianops.h Fri Mar 21 20:26:36 2014 +0100
|
||||
|
+++ b/lib/libucsi/endianops.h Fri Jan 19 06:56:15 2018 +0000
|
||||
|
@@ -33,6 +33,9 @@
|
||||
|
#define __ucsi_packed __attribute__((packed)) |
||||
|
|
||||
|
|
||||
|
+#if __GNUC__ >= 6 + (0 >= __GNUC_MINOR__)
|
||||
|
+#pragma GCC optimize ("O1")
|
||||
|
+#endif
|
||||
|
|
||||
|
|
||||
|
#if __BYTE_ORDER == __BIG_ENDIAN |
@ -0,0 +1,24 @@ |
|||||
|
Index: dvb-apps/util/dst-utils/dst_test.c
|
||||
|
===================================================================
|
||||
|
--- dvb-apps.orig/util/dst-utils/dst_test.c
|
||||
|
+++ dvb-apps/util/dst-utils/dst_test.c
|
||||
|
@@ -35,7 +35,18 @@
|
||||
|
#include <libdvben50221/en50221_app_tags.h> |
||||
|
|
||||
|
#define CA_NODE "/dev/dvb/adapter0/ca0" |
||||
|
-
|
||||
|
+/*
|
||||
|
+ Quick hack around the removal of ca_pid_t and CA_GET_PID in recent kernels
|
||||
|
+ https://github.com/torvalds/linux/commit/833ff5e7feda1a042b83e82208cef3d212ca0ef1
|
||||
|
+*/
|
||||
|
+#ifndef CA_SET_PID
|
||||
|
+typedef struct ca_pid {
|
||||
|
+ unsigned int pid;
|
||||
|
+ int index; /* -1 == disable*/
|
||||
|
+} ca_pid_t;
|
||||
|
+/* We should not be able to get it so a number that is unlikely to happen */
|
||||
|
+#define CA_SET_PID 42424242
|
||||
|
+#endif
|
||||
|
static int dst_comms(int cafd, uint32_t tag, uint32_t function, struct ca_msg *msg) |
||||
|
{ |
||||
|
if (tag) { |
@ -1,21 +0,0 @@ |
|||||
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; |
|
||||
} |
|
Loading…
Reference in new issue