Linux bluetooth development
 help / color / mirror / Atom feed
From: Bastien Nocera <hadess@hadess.net>
To: linux-bluetooth@vger.kernel.org
Subject: [RFC] tools: Fix build after y2038 changes in glibc
Date: Fri,  7 Jun 2019 09:51:33 +0200	[thread overview]
Message-ID: <20190607075133.11255-1-hadess@hadess.net> (raw)

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


             reply	other threads:[~2019-06-07  7:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-07  7:51 Bastien Nocera [this message]
2019-06-07  8:01 ` [RFC] tools: Fix build after y2038 changes in glibc Bastien Nocera
2019-07-06 13:56 ` Marcel Holtmann

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=20190607075133.11255-1-hadess@hadess.net \
    --to=hadess@hadess.net \
    --cc=linux-bluetooth@vger.kernel.org \
    /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