linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] tools: Fix build after y2038 changes in glibc
@ 2019-06-07  7:51 Bastien Nocera
  2019-06-07  8:01 ` Bastien Nocera
  2019-07-06 13:56 ` Marcel Holtmann
  0 siblings, 2 replies; 3+ messages in thread
From: Bastien Nocera @ 2019-06-07  7:51 UTC (permalink / raw)
  To: linux-bluetooth

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [RFC] tools: Fix build after y2038 changes in glibc
  2019-06-07  7:51 [RFC] tools: Fix build after y2038 changes in glibc Bastien Nocera
@ 2019-06-07  8:01 ` Bastien Nocera
  2019-07-06 13:56 ` Marcel Holtmann
  1 sibling, 0 replies; 3+ messages in thread
From: Bastien Nocera @ 2019-06-07  8:01 UTC (permalink / raw)
  To: linux-bluetooth

On Fri, 2019-06-07 at 09:51 +0200, Bastien Nocera wrote:
> The 32-bit SIOCGSTAMP has been deprecated. Use the deprecated name
> to fix the build.

Without this patch (or a port to the new 64-bit timestamps) you'd get
this error on newer glibcs:
BUILDSTDERR: tools/rctest.c: In function 'recv_mode':
BUILDSTDERR: tools/rctest.c:507:19: error: 'SIOCGSTAMP' undeclared (first use in this function); did you mean 'SIOCGARP'?
BUILDSTDERR:   507 |     if (ioctl(sk, SIOCGSTAMP, &tv) < 0) {
BUILDSTDERR:       |                   ^~~~~~~~~~
BUILDSTDERR:       |                   SIOCGARP
BUILDSTDERR: tools/rctest.c:507:19: note: each undeclared identifier is reported only once for each function it appears in
BUILDSTDERR: make[1]: *** [Makefile:6224: tools/rctest.o] Error 1
BUILDSTDERR: make[1]: *** Waiting for unfinished jobs....
BUILDSTDERR: tools/l2test.c: In function 'recv_mode':
BUILDSTDERR: tools/l2test.c:909:19: error: 'SIOCGSTAMP' undeclared (first use in this function); did you mean 'SIOCGARP'?
BUILDSTDERR:   909 |     if (ioctl(sk, SIOCGSTAMP, &tv) < 0) {
BUILDSTDERR:       |                   ^~~~~~~~~~
BUILDSTDERR:       |                   SIOCGARP
BUILDSTDERR: tools/l2test.c:909:19: note: each undeclared identifier is reported only once for each function it appears in

Given that those are tests that there's another 19 years to port, and
that I don't know how to test, I went for the quickest fix.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFC] tools: Fix build after y2038 changes in glibc
  2019-06-07  7:51 [RFC] tools: Fix build after y2038 changes in glibc Bastien Nocera
  2019-06-07  8:01 ` Bastien Nocera
@ 2019-07-06 13:56 ` Marcel Holtmann
  1 sibling, 0 replies; 3+ messages in thread
From: Marcel Holtmann @ 2019-07-06 13:56 UTC (permalink / raw)
  To: Bastien Nocera; +Cc: linux-bluetooth

Hi Bastien,

> 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(-)

patch has been applied.

Regards

Marcel


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-07-06 13:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-07  7:51 [RFC] tools: Fix build after y2038 changes in glibc Bastien Nocera
2019-06-07  8:01 ` Bastien Nocera
2019-07-06 13:56 ` Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).