From: J-P Nurmi Date: Sun, 9 Aug 2020 20:24:39 +0000 (+0200) Subject: sp_close(): disable exclusive mode to allow re-opening the port later X-Git-Tag: libserialport-0.1.2~6 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=32b94b12cac47933b0e06d317eaa37a539d207c1;p=libserialport.git sp_close(): disable exclusive mode to allow re-opening the port later --- diff --git a/serialport.c b/serialport.c index d15c664..1135c36 100644 --- a/serialport.c +++ b/serialport.c @@ -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");