From f12a9634c8df853a47daffd4c8ea0a0a7b52377d Mon Sep 17 00:00:00 2001 From: Guillaume Cottenceau Date: Mon, 16 Sep 2002 10:15:26 +0000 Subject: remove modules files even when modprobe fails --- rescue/tree/sbin/modprobe | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rescue/tree/sbin/modprobe b/rescue/tree/sbin/modprobe index 811c75111..84de032e2 100755 --- a/rescue/tree/sbin/modprobe +++ b/rescue/tree/sbin/modprobe @@ -29,8 +29,10 @@ sub load { system("packdrake -x /modules/modules.cz* /tmp $name.o"); -r "/tmp/$name.o" or die "can't find module $name\n"; - system("/sbin/insmod /tmp/$name.o"); $? and die("insmod $name failed"); + system("/sbin/insmod /tmp/$name.o"); + my $retval = $?; system("rm /tmp/$name.o"); + $retval and die("insmod $name failed"); } !@ARGV || $ARGV[0] =~ /-h/ and die "usage: modprobe []\n"; -- cgit v1.2.1