_nix based. Fixed clearing exclusive access on port close.

This commit is contained in:
Alexey Sokolov 2013-04-09 09:32:25 +03:00
parent 61096c5a5d
commit 6eded5cc1d
1 changed files with 3 additions and 0 deletions

View File

@ -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;
} }