Add missing O_CLOEXEC in kmod_module_get_size()
authorCristian Rodríguez <crrodriguez@opensuse.org>
Thu, 19 Jun 2014 00:51:00 +0000 (20:51 -0400)
committerLucas De Marchi <lucas.demarchi@intel.com>
Thu, 19 Jun 2014 21:01:37 +0000 (18:01 -0300)
libkmod/libkmod-module.c

index e3cc5a7..b81b451 100644 (file)
@@ -1783,7 +1783,7 @@ KMOD_EXPORT long kmod_module_get_size(const struct kmod_module *mod)
         * loaded.
         */
        snprintf(line, sizeof(line), "/sys/module/%s", mod->name);
-       dfd = open(line, O_RDONLY);
+       dfd = open(line, O_RDONLY|O_CLOEXEC);
        if (dfd < 0)
                return -errno;