_nix based. Fixed clearing exclusive access on port close.
This commit is contained in:
parent
61096c5a5d
commit
6eded5cc1d
|
@ -399,6 +399,9 @@ JNIEXPORT jboolean JNICALL Java_jssc_SerialNativeInterface_purgePort
|
||||||
/* Closing the port */
|
/* Closing the port */
|
||||||
JNIEXPORT jboolean JNICALL Java_jssc_SerialNativeInterface_closePort
|
JNIEXPORT jboolean JNICALL Java_jssc_SerialNativeInterface_closePort
|
||||||
(JNIEnv *env, jobject object, jint portHandle){
|
(JNIEnv *env, jobject object, jint portHandle){
|
||||||
|
#if defined TIOCNXCL && !defined __SunOS
|
||||||
|
ioctl(portHandle, TIOCNXCL);//since 2.1.0 Clear exclusive port access on closing
|
||||||
|
#endif
|
||||||
return close(portHandle) == 0 ? JNI_TRUE : JNI_FALSE;
|
return close(portHandle) == 0 ? JNI_TRUE : JNI_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue