From 4f8d077fb56d4e018f718627b3d732dbadfaf313 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Mon, 29 Jun 2009 15:48:12 +0300 Subject: [PATCH] obexd: Remove redundant stat() call Calling stat() before dlopen() is useless since in theory the file can get removed between the two calls and so dlopen() needs to be able to handle ENOENT in any case. --- obexd/src/plugin.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/obexd/src/plugin.c b/obexd/src/plugin.c index f3854b6bb..628008589 100644 --- a/obexd/src/plugin.c +++ b/obexd/src/plugin.c @@ -96,7 +96,6 @@ gboolean plugin_init(void) struct obex_plugin_desc *desc; void *handle; gchar *filename; - struct stat st; if (g_str_has_prefix(file, "lib") == TRUE || g_str_has_suffix(file, ".so") == FALSE) @@ -104,13 +103,6 @@ gboolean plugin_init(void) filename = g_build_filename(PLUGINDIR, file, NULL); - if (stat(filename, &st) < 0) { - error("Can't find plugin %s: %s", filename, - strerror(errno)); - g_free(filename); - continue; - } - handle = dlopen(filename, PLUGINFLAG); if (handle == NULL) { error("Can't load plugin %s: %s", filename, -- 2.47.3