Skip to content

Commit de462c7

Browse files
committed
modbus-rtu: don't use O_EXCL when opening the device
Quote from 'man 2 open': -snip- ... In general, the behavior of O_EXCL is undefined if it is used without O_CREAT. ... -snap- Since we don't create the device file here - we just want to open (hopefully) existing ones - let's simply drop this flag to be on the safe side. Signed-off-by: Michael Heimpold <[email protected]>
1 parent dde16d5 commit de462c7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/modbus-rtu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ static int _modbus_rtu_connect(modbus_t *ctx)
641641
642642
Timeouts are ignored in canonical input mode or when the
643643
NDELAY option is set on the file via open or fcntl */
644-
flags = O_RDWR | O_NOCTTY | O_NDELAY | O_EXCL;
644+
flags = O_RDWR | O_NOCTTY | O_NDELAY;
645645
#ifdef O_CLOEXEC
646646
flags |= O_CLOEXEC;
647647
#endif

0 commit comments

Comments
 (0)