From 3a965fdadccea7beff09a28c9c0ef4b4975eae38 Mon Sep 17 00:00:00 2001 From: Aaron Plattner Date: Thu, 20 Sep 2007 16:22:24 -0700 Subject: [PATCH] Don't segfault on shutdown if we never managed to connect to dbus. --- config/dbus-core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/dbus-core.c b/config/dbus-core.c index 28881596f..eab72a530 100644 --- a/config/dbus-core.c +++ b/config/dbus-core.c @@ -87,7 +87,8 @@ teardown(void) dbus_connection_unref(bus_info.connection); RemoveBlockAndWakeupHandlers(block_handler, wakeup_handler, &bus_info); - RemoveGeneralSocket(bus_info.fd); + if (bus_info.fd != -1) + RemoveGeneralSocket(bus_info.fd); bus_info.fd = -1; bus_info.connection = NULL;