[BusyBox] strange rmmod behaviour...

Arne Bernin arne at matrix.loopback.org
Thu Jul 27 15:30:02 UTC 2000


Hi,

busybox rmmod returns TRUE, even if unloading of the modules failed
(while using something like "busybox rmmod isdn"). The error messages are
printed, the returncode is not changed. I attached a very small patch to fix
this. I think if i use something like "rmmod isdn epic100 8390" and removing
of one of the three failed, the program should return false. is that right,
or just my opinion...


-- arne
-------------------------------------------------------------------
Arne Bernin                            	Netropol Digitale Systeme
					Lagerstrasse 30a                        
Tel: +49 4043250000                     D-20357 Hamburg/Germany
Fax: +49 40 43189490                    ab at Netropol.de    
                                                             
    
-------------- next part --------------
diff -urN busybox.orig/rmmod.c busybox/rmmod.c
--- busybox.orig/rmmod.c	Mon Jun 19 19:25:40 2000
+++ busybox/rmmod.c	Thu Jul 27 17:07:35 2000
@@ -48,6 +48,8 @@
 
 extern int rmmod_main(int argc, char **argv)
 {
+  int returncode = TRUE;
+
 	if (argc <= 1) {
 		usage(rmmod_usage);
 	}
@@ -72,8 +74,9 @@
 	while (argc-- > 0) {
 		if (delete_module(*argv) < 0) {
 			perror(*argv);
+			returncode = FALSE ;
 		}
 		argv++;
 	}
-	return(TRUE);
+	return(returncode);
 }


More information about the busybox mailing list