소스 검색

将__O_CLOEXEC变为O_CLOEXEC,便于移植

niujiuru 15 시간 전
부모
커밋
87a50e366b
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      swapi/subjects/serial/serial.c

+ 1 - 1
swapi/subjects/serial/serial.c

@@ -59,7 +59,7 @@ void *serial_open(const char *serialName, int baudrate, const char *parityCheck
     }
 
     /* 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(flock(pSerial->fd, LOCK_EX | LOCK_NB) == -1) goto ErrorP;