From 05a890df0ade7c4958a2a13ed0c6471e4658a098 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Thu, 1 Dec 2011 23:45:42 -0800 Subject: [PATCH] LoaderOpen returns either a valid pointer or NULL, so don't check for < 0 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 Reviewed-by: Adam Jackson (cherry picked from commit e4dcf580f007d6adcf5b0c639865d7aaab1a319d) --- hw/xfree86/loader/loadmod.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c index 9f820993a..20a471902 100644 --- a/hw/xfree86/loader/loadmod.c +++ b/hw/xfree86/loader/loadmod.c @@ -918,7 +918,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);