rmmod: Teach rmmod about builtin modules
authorJosh Boyer <jwboyer@redhat.com>
Fri, 15 Mar 2013 17:43:40 +0000 (13:43 -0400)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Mon, 18 Mar 2013 14:16:50 +0000 (11:16 -0300)
commitd53abca3bef50c2e0983821347d5da37e0ec3478
tree8f62bb47f245c9e7990d36990deb6363ae741ecc
parentc3e8d269466ab02e4c4a928f9f5af222f1138725
rmmod: Teach rmmod about builtin modules

Currently modprobe -r will fail if a module is built in and report that it
is built in.  rmmod calls the same function to determine state but doesn't
handle the KMOD_MODULE_BUILTIN return code.  This leads to confusing errors
like this:

libkmod: kmod_module_get_holders: could not open '/sys/module/loop/holders': No such file or directory
Error: Module loop is in use

Fix this so that it actually reports the correct problem to the user.
tools/rmmod.c