From 027f9642286c11f95aedbd9646fb2ee08a9d55a1 Mon Sep 17 00:00:00 2001 From: Philip Kovacs Date: Thu, 12 Jan 2006 00:27:58 +0000 Subject: [PATCH] xmms check_dlerror() git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky@498 7f574dfc-610e-0410-a909-a81674777703 --- src/xmms.c | 54 +++++++++++++++++------------------------------------- 1 file changed, 17 insertions(+), 37 deletions(-) diff --git a/src/xmms.c b/src/xmms.c index c9d0a586..8722654f 100644 --- a/src/xmms.c +++ b/src/xmms.c @@ -169,7 +169,7 @@ int destroy_xmms_thread(void) #if defined(XMMS) || defined(BMP) || defined(AUDACIOUS) void check_dlerror(void) { - const char *error; + static const char *error; if ((error = dlerror()) != NULL) { ERR("error grabbing function symbol"); @@ -243,50 +243,30 @@ void *xmms_thread_func_dynamic(void *pvoid) check_dlerror(); xmms_remote_is_paused = dlsym(handle, "xmms_remote_is_paused"); - if ((error = dlerror()) != NULL) { - ERR("error grabbing function symbol"); - pthread_exit(NULL); - } + check_dlerror(); + xmms_remote_is_playing = dlsym(handle, "xmms_remote_is_playing"); - if ((error = dlerror()) != NULL) { - ERR("error grabbing function symbol"); - pthread_exit(NULL); - } + check_dlerror(); + xmms_remote_get_playlist_pos = dlsym(handle, "xmms_remote_get_playlist_pos"); - if ((error = dlerror()) != NULL) { - ERR("error grabbing function symbol"); - pthread_exit(NULL); - } + check_dlerror(); + xmms_remote_get_playlist_title = dlsym(handle, "xmms_remote_get_playlist_title"); - if ((error = dlerror()) != NULL) { - ERR("error grabbing function symbol"); - pthread_exit(NULL); - } + check_dlerror(); + xmms_remote_get_playlist_time = dlsym(handle, "xmms_remote_get_playlist_time"); - if ((error = dlerror()) != NULL) { - ERR("error grabbing function symbol"); - pthread_exit(NULL); - } + check_dlerror(); + xmms_remote_get_output_time = dlsym(handle, "xmms_remote_get_output_time"); - if ((error = dlerror()) != NULL) { - ERR("error grabbing function symbol"); - pthread_exit(NULL); - } + check_dlerror(); + xmms_remote_get_info = dlsym(handle, "xmms_remote_get_info"); - if ((error = dlerror()) != NULL) { - ERR("error grabbing function symbol"); - pthread_exit(NULL); - } + xmms_remote_get_playlist_file = dlsym(handle, "xmms_remote_get_playlist_file"); - if ((error = dlerror()) != NULL) { - ERR("error grabbing function symbol"); - pthread_exit(NULL); - } + check_dlerror(); + xmms_remote_get_playlist_length = dlsym(handle, "xmms_remote_get_playlist_length"); - if ((error = dlerror()) != NULL) { - ERR("error grabbing function symbol"); - pthread_exit(NULL); - } + check_dlerror(); /* Grab the runnable signal. Should be non-zero here or we do nothing. */ pthread_mutex_lock(&info.xmms.runnable_mutex);