aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormichux <michux@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2008-02-27 14:06:20 +0000
committermichux <michux@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2008-02-27 14:06:20 +0000
commit0086015d0f85c4df2e2abd8cf586033593452db3 (patch)
tree5dad7b42b41c5a975f25c04eef9a65e4c7dadb0c
parentd659635b44595c039e74851bc1e1ccf6e677bbf9 (diff)
downloadlcd4linux-0086015d0f85c4df2e2abd8cf586033593452db3.tar.gz
add signal handler to plugin_mpd
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@854 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
Diffstat (limited to '')
-rw-r--r--plugin_mpd.c5
-rw-r--r--plugins.m422
2 files changed, 13 insertions, 14 deletions
diff --git a/plugin_mpd.c b/plugin_mpd.c
index e6a9417..bdf22ed 100644
--- a/plugin_mpd.c
+++ b/plugin_mpd.c
@@ -77,6 +77,7 @@ TODO:
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
+#include <signal.h>
#include "debug.h"
#include "plugin.h"
@@ -577,7 +578,9 @@ int plugin_init_mpd(void)
debug("[MPD] configured!");
else
debug("[MPD] error, NOT configured!");
-
+
+ //when mpd dies, do NOT exit application, ignore it!
+ signal(SIGPIPE, SIG_IGN);
gettimeofday(&timestamp, NULL);
AddFunction("mpd::artist", 0, getArtist);
diff --git a/plugins.m4 b/plugins.m4
index dd67e9d..254044f 100644
--- a/plugins.m4
+++ b/plugins.m4
@@ -256,20 +256,16 @@ if test "$PLUGIN_MEMINFO" = "yes"; then
PLUGINS="$PLUGINS plugin_meminfo.o"
AC_DEFINE(PLUGIN_MEMINFO,1,[meminfo plugin])
fi
-if test "$PLUGIN_MPD" = "yes"; then
- AC_CHECK_HEADERS(libmpd/libmpd.h, [has_libmpd_header="true"], [has_libmpd_header="false"])
- if test "$has_libmpd_header" = "true"; then
- AC_CHECK_LIB(mpd, mpd_connect, [has_libmpd_lib="true"], [has_libmpd_lib="false"])
- if test "$has_libmpd_lib" = "true"; then
- PLUGINS="$PLUGINS plugin_mpd.o"
- PLUGINLIBS="$PLUGINLIBS -lmpd"
- AC_DEFINE(PLUGIN_MPD,1,[mpd plugin])
- else
- AC_MSG_WARN(libmpd lib not found: mpd plugin disabled)
- fi
+if test "$PLUGIN_MPD" = "yes"; then
+ if test -f "libmpdclient.h"
+ then
+ PLUGINS="$PLUGINS plugin_mpd.o libmpdclient.o"
+ AC_DEFINE(PLUGIN_MPD,1,[mpd plugin])
else
- AC_MSG_WARN(libmpd/libmpd.h header not found: mpd plugin disabled)
- fi
+ AC_MSG_WARN(libmpdclient.h header not found: mpd plugin disabled)
+ AC_MSG_WARN(get libmpdclient.h from http://www.musicpd.org/libmpdclient.shtml)
+ AC_MSG_WARN(and copy those 2 files in the lcd4linux directory.)
+ fi
fi
if test "$PLUGIN_MYSQL" = "yes"; then
AC_CHECK_HEADERS(mysql/mysql.h, [has_mysql_header="true"], [has_mysql_header="false"])