Skip to content

Commit 376d0ba

Browse files
authored
Merge pull request #17 from rm5248/javaserial-16
Fix for #16
2 parents b9fe070 + 1f1d6e5 commit 376d0ba

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)