Prechádzať zdrojové kódy

ncd/interface_modules/interface_badvpn: log error if we can't destory the device

ambrop7 15 rokov pred
rodič
commit
2b5d2cdfb0
1 zmenil súbory, kde vykonal 3 pridanie a 1 odobranie
  1. 3 1
      ncd/interface_modules/interface_badvpn.c

+ 3 - 1
ncd/interface_modules/interface_badvpn.c

@@ -178,7 +178,9 @@ static void func_free (void *vo)
     BProcess_Free(&o->process);
     BProcess_Free(&o->process);
     
     
     // remove TAP device
     // remove TAP device
-    NCDIfConfig_remove_tuntap(o->i->conf->name, 0);
+    if (!NCDIfConfig_remove_tuntap(o->i->conf->name, 0)) {
+        NCDInterfaceModuleInst_Backend_Log(o->i, BLOG_ERROR, "failed to remove TAP device");
+    }
     
     
     // free instance
     // free instance
     free(o);
     free(o);