Skip to content

Commit 1f1d6e5

Browse files
committed
Fix for #16
1 parent b9fe070 commit 1f1d6e5

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

NativeCode/SerialPortImpl.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,6 +1174,10 @@ JNIEXPORT jint JNICALL Java_com_rm5248_serial_SerialPort_getSerialLineStateInter
11741174
#else
11751175
int get_val;
11761176
if( ioctl( desc->port, TIOCMGET, &get_val ) < 0 ){
1177+
/* TIOCMGET can fail on linux if not implemented(example: pty) */
1178+
if( errno == EINVAL ){
1179+
return 0;
1180+
}
11771181
throw_io_exception( env, errno );
11781182
return -1;
11791183
}

0 commit comments

Comments
 (0)