]> sigrok.org Git - libserialport.git/commitdiff
sp_close(): disable exclusive mode to allow re-opening the port later
authorJ-P Nurmi <redacted>
Sun, 9 Aug 2020 20:24:39 +0000 (22:24 +0200)
committerSoeren Apel <redacted>
Fri, 30 Aug 2024 21:13:10 +0000 (23:13 +0200)
serialport.c

index d15c664ff1dbfb0a4c58bdca82df945c8c871101..1135c36b4978328a7c42a9c23006641a3f8185ff 100644 (file)
@@ -693,6 +693,10 @@ SP_API enum sp_return sp_close(struct sp_port *port)
                port->write_buf = NULL;
        }
 #else
+#ifdef TIOCNXCL
+       ioctl(port->fd, TIOCNXCL);
+#endif
+
        /* Returns 0 upon success, -1 upon failure. */
        if (close(port->fd) == -1)
                RETURN_FAIL("close() failed");