From 5c6421f107cf2d1f1a406bb20741dc90c8c52d43 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Fri, 7 Jun 2019 09:28:20 +0200 Subject: [PATCH] Add y2038 build fix --- ...x-build-after-y2038-changes-in-glibc.patch | 63 +++++++++++++++++++ bluez.spec | 2 + 2 files changed, 65 insertions(+) create mode 100644 0001-tools-Fix-build-after-y2038-changes-in-glibc.patch diff --git a/0001-tools-Fix-build-after-y2038-changes-in-glibc.patch b/0001-tools-Fix-build-after-y2038-changes-in-glibc.patch new file mode 100644 index 0000000..8e1009e --- /dev/null +++ b/0001-tools-Fix-build-after-y2038-changes-in-glibc.patch @@ -0,0 +1,63 @@ +From 3a8cc80e916bd9b88a33cd08ccbd99e43113d530 Mon Sep 17 00:00:00 2001 +From: Bastien Nocera +Date: Fri, 7 Jun 2019 09:25:12 +0200 +Subject: [PATCH] tools: Fix build after y2038 changes in glibc + +The 32-bit SIOCGSTAMP has been deprecated. Use the deprecated name +to fix the build. +--- + tools/l2test.c | 6 +++++- + tools/rctest.c | 6 +++++- + 2 files changed, 10 insertions(+), 2 deletions(-) + +diff --git a/tools/l2test.c b/tools/l2test.c +index e755ac881..e787c2ce2 100644 +--- a/tools/l2test.c ++++ b/tools/l2test.c +@@ -55,6 +55,10 @@ + #define BREDR_DEFAULT_PSM 0x1011 + #define LE_DEFAULT_PSM 0x0080 + ++#ifndef SIOCGSTAMP_OLD ++#define SIOCGSTAMP_OLD SIOCGSTAMP ++#endif ++ + /* Test modes */ + enum { + SEND, +@@ -907,7 +911,7 @@ static void recv_mode(int sk) + if (timestamp) { + struct timeval tv; + +- if (ioctl(sk, SIOCGSTAMP, &tv) < 0) { ++ if (ioctl(sk, SIOCGSTAMP_OLD, &tv) < 0) { + timestamp = 0; + memset(ts, 0, sizeof(ts)); + } else { +diff --git a/tools/rctest.c b/tools/rctest.c +index 94490f462..bc8ed875d 100644 +--- a/tools/rctest.c ++++ b/tools/rctest.c +@@ -50,6 +50,10 @@ + + #include "src/shared/util.h" + ++#ifndef SIOCGSTAMP_OLD ++#define SIOCGSTAMP_OLD SIOCGSTAMP ++#endif ++ + /* Test modes */ + enum { + SEND, +@@ -505,7 +509,7 @@ static void recv_mode(int sk) + if (timestamp) { + struct timeval tv; + +- if (ioctl(sk, SIOCGSTAMP, &tv) < 0) { ++ if (ioctl(sk, SIOCGSTAMP_OLD, &tv) < 0) { + timestamp = 0; + memset(ts, 0, sizeof(ts)); + } else { +-- +2.21.0 + diff --git a/bluez.spec b/bluez.spec index 244a1f1..99633f6 100644 --- a/bluez.spec +++ b/bluez.spec @@ -41,6 +41,8 @@ Patch42: bluez-5.50-discoverability-backports.patch Patch43: bluez-5.50-a2dp-backports.patch # sixaxis pairing fixes Patch44: bluez-5.50-sixaxis-fixes.patch +# y2038 build fix +Patch45: 0001-tools-Fix-build-after-y2038-changes-in-glibc.patch BuildRequires: git-core BuildRequires: dbus-devel >= 1.6