|
@@ -59,7 +59,7 @@ void *serial_open(const char *serialName, int baudrate, const char *parityCheck
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/* 2, 打开串口 */
|
|
/* 2, 打开串口 */
|
|
|
- pSerial->fd = open(pSerial->name, O_RDWR | O_NOCTTY | O_NDELAY | __O_CLOEXEC);
|
|
|
|
|
|
|
+ pSerial->fd = open(pSerial->name, O_RDWR | O_NOCTTY | O_NDELAY | O_CLOEXEC);
|
|
|
if(pSerial->fd == -1) goto ErrorP;
|
|
if(pSerial->fd == -1) goto ErrorP;
|
|
|
|
|
|
|
|
if(flock(pSerial->fd, LOCK_EX | LOCK_NB) == -1) goto ErrorP;
|
|
if(flock(pSerial->fd, LOCK_EX | LOCK_NB) == -1) goto ErrorP;
|