From 8b6752e826a02f1a3efa94262836caa98333ee23 Mon Sep 17 00:00:00 2001 From: handa Date: Sun, 18 Jul 2004 07:42:12 +0000 Subject: [PATCH] (mframe): Print error message give by dlopen to stderr. --- src/m17n-gui.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) 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); } } -- 1.7.10.4