From: handa Date: Sun, 18 Jul 2004 07:42:12 +0000 (+0000) Subject: (mframe): Print error message give by dlopen to X-Git-Tag: REL-1-1-0~97 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8b6752e826a02f1a3efa94262836caa98333ee23;p=m17n%2Fm17n-lib.git (mframe): Print error message give by dlopen to stderr. --- diff --git a/src/m17n-gui.c b/src/m17n-gui.c index 728280a..cac713a 100644 --- a/src/m17n-gui.c +++ b/src/m17n-gui.c @@ -636,16 +636,15 @@ mframe (MPlist *plist) MERROR (MERROR_WIN, NULL); if (! interface->handle) { - interface->handle = dlopen (interface->library, RTLD_NOW); - if (! interface->handle) - MERROR (MERROR_WIN, NULL); - interface->init = dlsym (interface->handle, "device_init"); - interface->open = dlsym (interface->handle, "device_open"); - interface->fini = dlsym (interface->handle, "device_fini"); - if (! interface->init || ! interface->open || ! interface->fini + if (! (interface->handle = dlopen (interface->library, RTLD_NOW)) + || ! (interface->init = dlsym (interface->handle, "device_init")) + || ! (interface->open = dlsym (interface->handle, "device_open")) + || ! (interface->fini = dlsym (interface->handle, "device_fini")) || (*interface->init) () < 0) { - dlclose (interface->handle); + fprintf (stderr, "%s\n", (char *) dlerror ()); + if (interface->handle) + dlclose (interface->handle); MERROR (MERROR_WIN, NULL); } }