[PATCH 4/5] LoaderOpen returns either a valid pointer or NULL, so don't check for < 0

Alan Coopersmith alan.coopersmith at oracle.com
Fri Dec 2 10:48:15 PST 2011


Fixes Sun cc warning that was recently elevated to error by the
stricter default CFLAGS changes to xorg-macros:

"loadmod.c", line 914: improper pointer/integer combination: op "<"

Should have been changed when commit ab7f057ce9df4e905b12 changed the
LoaderOpen return type from int to void *.

Changes log message when file is found but dlopen() fails from:
 (EE) LoadModule: Module dbe does not have a dbeModuleData data object.
 (EE) Failed to load module "dbe" (invalid module, 0)
to:
 (EE) Failed to load module "dbe" (loader failed, 7)

Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
 hw/xfree86/loader/loadmod.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c
index c697d74..5b9f8d1 100644
--- a/hw/xfree86/loader/loadmod.c
+++ b/hw/xfree86/loader/loadmod.c
@@ -911,7 +911,7 @@ doLoadModule(const char *module, const char *path, const char **subdirlist,
 	goto LoadModule_fail;
     }
     ret->handle = LoaderOpen(found, errmaj, errmin);
-    if (ret->handle < 0)
+    if (ret->handle == NULL)
 	goto LoadModule_fail;
     ret->path = strdup(found);
 
-- 
1.7.3.2



More information about the xorg-devel mailing list