Skip to content
This repository was archived by the owner on Aug 9, 2022. It is now read-only.

Commit a8cd90f

Browse files
committed
Removing unnecessary compiler warning.
RXTX uses UTS_RELEASE to check the current kernel version (in order to compare to the one it was built under and give a warning if they don't match). Unfortunately, the location of this define has moved in the kernel I have. Since the warning isn't that useful anyway, I'm just commenting out the relevant check rather than fixing the include. This is also what Debian did, it seems.
1 parent d15384b commit a8cd90f

File tree

4 files changed

+9
-1
lines changed

4 files changed

+9
-1
lines changed

src/I2CImp.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,9 @@ JNIEXPORT void JNICALL Java_gnu_io_I2CPort_Initialize(
8686
sigaction( SIGIO, NULL, &handler );
8787
if( !handler.sa_handler ) signal( SIGIO, SIG_IGN );
8888
#endif /* !__FreeBSD__ */
89-
#if defined(__linux__)
89+
#if defined(__linux__)
9090
/* Lets let people who upgraded kernels know they may have problems */
91+
/*
9192
if (uname (&name) == -1)
9293
{
9394
fprintf(stderr,"RXTX WARNING: cannot get system name\n");
@@ -98,6 +99,7 @@ JNIEXPORT void JNICALL Java_gnu_io_I2CPort_Initialize(
9899
fprintf(stderr, "\n\n\nRXTX WARNING: This library was compiled to run with OS release %s and you are currently running OS release %s. In some cases this can be a problem. Try recompiling RXTX if you notice strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the include files that came with the kernel source and not an older copy.\n\n\npress enter to continue\n",UTS_RELEASE,name.release);
99100
getchar();
100101
}
102+
*/
101103
#endif /* __linux__ */
102104
#endif /* WIN32 */
103105
}

src/RS485Imp.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ JNIEXPORT void JNICALL Java_gnu_io_RS485Port_Initialize(
8888
#endif /* !__FreeBSD__ */
8989
#if defined(__linux__)
9090
/* Lets let people who upgraded kernels know they may have problems */
91+
/*
9192
if (uname (&name) == -1)
9293
{
9394
fprintf(stderr,"RXTX WARNING: cannot get system name\n");
@@ -98,6 +99,7 @@ JNIEXPORT void JNICALL Java_gnu_io_RS485Port_Initialize(
9899
fprintf(stderr, "\n\n\nRXTX WARNING: This library was compiled to run with OS release %s and you are currently running OS release %s. In some cases this can be a problem. Try recompiling RXTX if you notice strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the include files that came with the kernel source and not an older copy.\n\n\npress enter to continue\n",UTS_RELEASE,name.release);
99100
getchar();
100101
}
102+
*/
101103
#endif /* __linux__ */
102104
#endif /* WIN32 */
103105
}

src/RawImp.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ JNIEXPORT void JNICALL Java_gnu_io_RawPort_Initialize(
232232
#endif /* !__FreeBSD__ */
233233
#if defined(__linux__)
234234
/* Lets let people who upgraded kernels know they may have problems */
235+
/*
235236
if (uname (&name) == -1)
236237
{
237238
fprintf(stderr,"RXTX WARNING: cannot get system name\n");
@@ -242,6 +243,7 @@ JNIEXPORT void JNICALL Java_gnu_io_RawPort_Initialize(
242243
fprintf(stderr, "\n\n\nRXTX WARNING: This library was compiled to run with OS release %s and you are currently running OS release %s. In some cases this can be a problem. Try recompiling RXTX if you notice strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the include files that came with the kernel source and not an older copy.\n\n\npress enter to continue\n",UTS_RELEASE,name.release);
243244
getchar();
244245
}
246+
*/
245247
#endif /* __linux__ */
246248
#endif /* WIN32 */
247249
}

src/SerialImp.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ JNIEXPORT void JNICALL RXTXPort(Initialize)(
281281
#endif /* DEBUG_TIMING */
282282
#if defined(DEBUG) && defined(__linux__)
283283
/* Lets let people who upgraded kernels know they may have problems */
284+
/*
284285
if (uname (&name) == -1)
285286
{
286287
report( "RXTX WARNING: cannot get system name\n" );
@@ -295,6 +296,7 @@ JNIEXPORT void JNICALL RXTXPort(Initialize)(
295296
getchar();
296297
}
297298
LEAVE( "RXTXPort:Initialize" );
299+
*/
298300
#endif /* DEBUG && __linux__ */
299301
}
300302

0 commit comments

Comments
 (0)