rmmod: behavior more like m-i-t's rmmod
authorDave Reisner <dreisner@archlinux.org>
Wed, 11 Jan 2012 00:28:30 +0000 (19:28 -0500)
committerDave Reisner <dreisner@archlinux.org>
Wed, 11 Jan 2012 03:35:18 +0000 (22:35 -0500)
commit6da9cdf1f784d4d765b17557a81e92507dadd16d
tree911a9428402ae23bc629b11053b967c9007bc53a
parentb54f1bf06aa450cdb4616ba9caed3c700588977f
rmmod: behavior more like m-i-t's rmmod

In line with m-i-t's behavior, we should check to see if each module is:

- loaded
- has any holders
- has a 0 refcnt

Detecting any of these lets us provide a more useful message than the
kernel's EPERM response to delete_module(2).

Additionally, alter the main loop behavior to avoid exiting early on the
first error.
tools/kmod-rmmod.c