소스 검색

LinuxInputDeviceManager: Fix fcntl() call

Mitchell Stokes 7 년 전
부모
커밋
ff66728212
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      panda/src/device/linuxInputDeviceManager.cxx

+ 2 - 1
panda/src/device/linuxInputDeviceManager.cxx

@@ -33,7 +33,8 @@ LinuxInputDeviceManager::
 LinuxInputDeviceManager() {
 LinuxInputDeviceManager() {
   // Use inotify to watch /dev/input for hotplugging of devices.
   // Use inotify to watch /dev/input for hotplugging of devices.
   _inotify_fd = inotify_init();
   _inotify_fd = inotify_init();
-  fcntl(_inotify_fd, O_NONBLOCK | O_CLOEXEC);
+  fcntl(_inotify_fd, F_SETFL, O_NONBLOCK);
+  fcntl(_inotify_fd, F_SETFD, FD_CLOEXEC);
 
 
   if (_inotify_fd < 0) {
   if (_inotify_fd < 0) {
     device_cat.error()
     device_cat.error()