[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[PATCH 6/6] improve functions for Modprobe overrides



---
 loader/driverdisk.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/loader/driverdisk.c b/loader/driverdisk.c
index d439b1c..ce3f8ac 100644
--- a/loader/driverdisk.c
+++ b/loader/driverdisk.c
@@ -64,7 +64,7 @@
 extern uint64_t flags;
 
 /* modprobe DD mode */
-int modprobeDDmode()
+int modprobeDDmode(void)
 {
     FILE *f = fopen("/etc/depmod.d/ddmode.conf", "w");
     if (f) {
@@ -78,9 +78,13 @@ int modprobeDDmode()
     return f==NULL;
 }
 
-int modprobeNormalmode()
+int modprobeNormalmode(void)
 {
-    unlink("/etc/depmod.d/ddmode.conf");
+    /* remove depmod overrides */
+    if (unlink("/etc/depmod.d/ddmode.conf")) {
+        logMessage(ERROR, "removing ddmode.conf failed");
+        return -1;
+    }
 
     /* run depmod to refresh modules db */
     if (system("depmod -a")) {
-- 
1.6.4.4


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]