aboutsummaryrefslogtreecommitdiff
path: root/network
diff options
context:
space:
mode:
authorDavid Somero <dsomero@hotmail.com>2010-09-14 23:32:14 -0500
committerRobby Workman <rworkman@slackbuilds.org>2010-09-14 23:32:14 -0500
commitd8731e9a034d82109e616d9edd17ebb1b8a24870 (patch)
treee100a6f88bc38d52f43bf9ee8fa7c4ac1e2926f3 /network
parent98fc976001f47ad82c21fce4369f50b68d0d134b (diff)
network/avahi: Bugfix for http://avahi.org/ticket/319 (patched)
Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
Diffstat (limited to 'network')
-rw-r--r--network/avahi/0001-Check-if-the-deamon-isn-t-already-running.patch69
-rw-r--r--network/avahi/README6
-rw-r--r--network/avahi/avahi.SlackBuild7
3 files changed, 77 insertions, 5 deletions
diff --git a/network/avahi/0001-Check-if-the-deamon-isn-t-already-running.patch b/network/avahi/0001-Check-if-the-deamon-isn-t-already-running.patch
new file mode 100644
index 000000000000..7a384db38d4f
--- /dev/null
+++ b/network/avahi/0001-Check-if-the-deamon-isn-t-already-running.patch
@@ -0,0 +1,69 @@
+From 55c732acd013b6ac979b6e1f5432a301481879ca Mon Sep 17 00:00:00 2001
+From: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
+Date: Sun, 15 Aug 2010 22:56:49 +0100
+Subject: [PATCH] Check if the deamon isn't already running
+
+---
+ avahi-client/client.c | 29 +++++++++++++++++++++++++----
+ 1 files changed, 25 insertions(+), 4 deletions(-)
+
+diff --git a/avahi-client/client.c b/avahi-client/client.c
+index be675ad..c7ece4a 100644
+--- a/avahi-client/client.c
++++ b/avahi-client/client.c
+@@ -478,6 +478,7 @@ static DBusConnection* avahi_dbus_bus_get(DBusError *error) {
+ AvahiClient *avahi_client_new(const AvahiPoll *poll_api, AvahiClientFlags flags, AvahiClientCallback callback, void *userdata, int *ret_error) {
+ AvahiClient *client = NULL;
+ DBusError error;
++ int daemon_running = 0;
+
+ avahi_init_i18n();
+
+@@ -560,12 +561,33 @@ AvahiClient *avahi_client_new(const AvahiPoll *poll_api, AvahiClientFlags flags,
+ if (dbus_error_is_set(&error))
+ goto fail;
+
+- if (!dbus_bus_start_service_by_name(client->bus, AVAHI_DBUS_NAME, 0, NULL, &error)) {
+
+- /* We free the error so its not set, that way the fail target
+- * will return the NO_DAEMON error rather than a DBUS error */
++ /* Check if the process already exists on the bus, otherwise try to start
++ * it. */
++ if (!dbus_bus_name_has_owner (client->bus, AVAHI_DBUS_NAME, &error)) {
++ dbus_error_free(&error);
++ daemon_running = 0;
++ } else {
++ daemon_running = 1;
++ }
++
++ if (!daemon_running &&
++ !dbus_bus_start_service_by_name(client->bus,
++ AVAHI_DBUS_NAME, 0, NULL, &error)) {
+ dbus_error_free(&error);
++ } else {
++ daemon_running = 1;
++ }
+
++ /* Re-check something else didn't start the daemon */
++ if (!daemon_running &&
++ !dbus_bus_name_has_owner (client->bus, AVAHI_DBUS_NAME, &error)) {
++ dbus_error_free(&error);
++ } else {
++ daemon_running = 1;
++ }
++
++ if (!daemon_running) {
+ if (!(flags & AVAHI_CLIENT_NO_FAIL)) {
+
+ if (ret_error)
+@@ -577,7 +599,6 @@ AvahiClient *avahi_client_new(const AvahiPoll *poll_api, AvahiClientFlags flags,
+ /* The user doesn't want this call to fail if the daemon is not
+ * available, so let's return succesfully */
+ client_set_state(client, AVAHI_CLIENT_CONNECTING);
+-
+ } else {
+
+ if (init_server(client, ret_error) < 0)
+--
+1.7.1
+
diff --git a/network/avahi/README b/network/avahi/README
index 679fbac3d684..6d736c9e4db4 100644
--- a/network/avahi/README
+++ b/network/avahi/README
@@ -11,5 +11,7 @@ prior to installing the avahi package. See README.SBo in this
directory (it is also installed to the package docmentation directory)
for more information and for setup notes.
-This requires libdaemon, mono is optional and also requires gtk-sharp.
-enable it with the following: MONO=yes ./avahi.SlackBuild
+This requires libdaemon.
+
+mono is an optional dependency that also requires gtk-sharp - enable it
+with the following: "MONO=yes ./avahi.SlackBuild"
diff --git a/network/avahi/avahi.SlackBuild b/network/avahi/avahi.SlackBuild
index 5974a83141f5..bb08877593cd 100644
--- a/network/avahi/avahi.SlackBuild
+++ b/network/avahi/avahi.SlackBuild
@@ -24,15 +24,13 @@
PRGNAM=avahi
VERSION=0.6.27
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
-# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i486 ;;
arm*) ARCH=arm ;;
- # Unless $ARCH is already set, use uname -m for all other archs:
*) ARCH=$( uname -m ) ;;
esac
fi
@@ -90,6 +88,9 @@ cd $PRGNAM-$VERSION
chown -R root:root .
chmod -R a-s,u+w,go+r-w .
+# Bug fix http://avahi.org/ticket/319
+patch -p1 < $CWD/0001-Check-if-the-deamon-isn-t-already-running.patch
+
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \