From: Dave Reisner Date: Sat, 31 Dec 2011 23:02:30 +0000 (-0500) Subject: modprobe: use lighter access call instead of stat X-Git-Tag: v3~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d98880ad5c8962a9c3dd7e6c79c2973532a7ed49;p=thirdparty%2Fkmod.git modprobe: use lighter access call instead of stat --- diff --git a/tools/kmod-modprobe.c b/tools/kmod-modprobe.c index cac0b477..b8d79b0e 100644 --- a/tools/kmod-modprobe.c +++ b/tools/kmod-modprobe.c @@ -555,9 +555,7 @@ static int rmmod_alias(struct kmod_ctx *ctx, const char *alias) static int rmmod(struct kmod_ctx *ctx, const char *name) { - struct stat st; - - if (stat(name, &st) == 0) + if (access(name, F_OK) == 0) return rmmod_path(ctx, name); else return rmmod_alias(ctx, name);