Jelajahi Sumber

ncd: modules: socket: Use O_NONBLOCK when opening a device node.

Ambroz Bizjak 11 tahun lalu
induk
melakukan
002281a5b8
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  1. 1 1
      ncd/modules/socket.c

+ 1 - 1
ncd/modules/socket.c

@@ -704,7 +704,7 @@ static void connect_func_new (void *vo, NCDModuleInst *i, const struct NCDModule
         }
         
         // open the device
-        int devfd = open(device_path_nts.data, O_RDWR);
+        int devfd = open(device_path_nts.data, O_RDWR|O_NONBLOCK);
         NCDValNullTermString_Free(&device_path_nts);
         if (devfd < 0) {
             ModuleLog(i, BLOG_ERROR, "open failed");