From b418a82097f666a87601b35572495e0f2fbcb1a3 Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Thu, 1 Dec 2011 23:13:27 -0200 Subject: [PATCH] Use fstat() instead of stat() when possible --- libkmod/libkmod-module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libkmod/libkmod-module.c b/libkmod/libkmod-module.c index 48d1b5e..6afa122 100644 --- a/libkmod/libkmod-module.c +++ b/libkmod/libkmod-module.c @@ -339,7 +339,7 @@ KMOD_EXPORT int kmod_module_insert_module(struct kmod_module *mod, return err; } - stat(mod->path, &st); + fstat(fd, &st); if ((mmaped_file = mmap(0, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0)) == MAP_FAILED) {