From 569b8bf5d763186777cf1461b9e92bd7d381220d Mon Sep 17 00:00:00 2001 From: Duncan Laurie Date: Tue, 3 Feb 2004 01:19:11 +0000 Subject: [PATCH] Author: Martin Pool Date: Mon Feb 2 15:07:00 EST 2004 This patch prints ltdl messages when an error occurs, to aid in debugging. --- ipmitool/src/plugins/ipmi_intf.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/ipmitool/src/plugins/ipmi_intf.c b/ipmitool/src/plugins/ipmi_intf.c index 8c9bd88..92652ae 100644 --- a/ipmitool/src/plugins/ipmi_intf.c +++ b/ipmitool/src/plugins/ipmi_intf.c @@ -50,13 +50,14 @@ extern struct static_intf static_intf_list[]; int ipmi_intf_init(void) { if (lt_dlinit() < 0) { - printf("ERROR: Unable to initialize ltdl\n"); + printf("ERROR: Unable to initialize ltdl: %s\n", + lt_dlerror()); return -1; } if (lt_dlsetsearchpath(PLUGIN_PATH) < 0) { - printf("ERROR: Unable to set ltdl plugin path to %s\n", - PLUGIN_PATH); + printf("ERROR: Unable to set ltdl plugin path to %s: %s\n", + PLUGIN_PATH, lt_dlerror()); lt_dlexit(); return -1; } @@ -70,7 +71,8 @@ int ipmi_intf_init(void) void ipmi_intf_exit(void) { if (lt_dlexit() < 0) - printf("ERROR: Unable to cleanly exit ltdl\n"); + printf("ERROR: Unable to cleanly exit ltdl: %s\n", + lt_dlerror()); } /* ipmi_intf_load @@ -104,14 +106,16 @@ struct ipmi_intf * ipmi_intf_load(char * name) handle = lt_dlopenext(libname); if (handle == NULL) { - printf("ERROR: Unable to find plugin '%s' in '%s'\n", - libname, PLUGIN_PATH); + printf("ERROR: Unable to find plugin '%s' in '%s': %s\n", + libname, PLUGIN_PATH, lt_dlerror()); return NULL; } setup = lt_dlsym(handle, "intf_setup"); if (!setup) { - printf("ERROR: Unable to find interface setup symbol in plugin %s\n", name); + printf("ERROR: Unable to find interface setup symbol " + "in plugin %s: %s\n", name, + lt_dlerror()); lt_dlclose(handle); return NULL; }