Patch from Yann E. Morin to make rmmod report failure properly.

This commit is contained in:
Rob Landley 2005-12-11 19:46:50 +00:00
parent 0bd0257fe0
commit 82327f4be4

View File

@ -78,7 +78,7 @@ extern int rmmod_main(int argc, char **argv)
size_t pnmod = -1; /* previous number of modules */ size_t pnmod = -1; /* previous number of modules */
while (nmod != pnmod) { while (nmod != pnmod) {
if (syscall(__NR_delete_module, NULL, flags) < 0) { if (syscall(__NR_delete_module, NULL, flags) != 0) {
if (errno==EFAULT) if (errno==EFAULT)
return(ret); return(ret);
bb_perror_msg_and_die("rmmod"); bb_perror_msg_and_die("rmmod");
@ -112,7 +112,7 @@ extern int rmmod_main(int argc, char **argv)
#else #else
#define module_name argv[n] #define module_name argv[n]
#endif #endif
if (syscall(__NR_delete_module, module_name, flags) < 0) { if (syscall(__NR_delete_module, module_name, flags) != 0) {
bb_perror_msg("%s", argv[n]); bb_perror_msg("%s", argv[n]);
ret = EXIT_FAILURE; ret = EXIT_FAILURE;
} }