Skip to content

Commit

Permalink
tools: Fix build after y2038 changes in glibc
Browse files Browse the repository at this point in the history
The 32-bit SIOCGSTAMP has been deprecated. Use the deprecated name
to fix the build.
  • Loading branch information
hadess authored and holtmann committed Jul 6, 2019
1 parent cf7d8a2 commit f36f71f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion tools/l2test.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 {
Expand Down
6 changes: 5 additions & 1 deletion tools/rctest.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@

#include "src/shared/util.h"

#ifndef SIOCGSTAMP_OLD
#define SIOCGSTAMP_OLD SIOCGSTAMP
#endif

/* Test modes */
enum {
SEND,
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit f36f71f

Please sign in to comment.