Ver Fonte

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

Ambroz Bizjak há 11 anos atrás
pai
commit
002281a5b8
1 ficheiros alterados com 1 adições e 1 exclusões
  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");