ypbind/ypbind-mt-1.20.4-nm.patch

54 lines
1.7 KiB
Diff

diff -up ypbind-mt-1.20.4/src/ypbind_dbus_nm.c.nm ypbind-mt-1.20.4/src/ypbind_dbus_nm.c
--- ypbind-mt-1.20.4/src/ypbind_dbus_nm.c.nm 2007-02-14 14:01:57.000000000 +0100
+++ ypbind-mt-1.20.4/src/ypbind_dbus_nm.c 2010-04-15 14:25:22.661754059 +0200
@@ -320,13 +320,13 @@ dbus_init (void)
if (check_online (connection) == 1)
{
if (debug_flag)
- log_msg (LOG_DEBUG, "Are already online");
- is_online = 1;
+ log_msg (LOG_DEBUG, "Network is available.");
+ go_online ();
}
else
{
if (debug_flag)
- log_msg (LOG_DEBUG, "Are offline");
+ log_msg (LOG_DEBUG, "No network is available. Waiting...");
is_online = 0;
}
return 1;
@@ -335,7 +335,7 @@ dbus_init (void)
{
if (debug_flag)
log_msg (LOG_DEBUG, "No connection possible, assume online mode");
- is_online = 1;
+ go_online ();
return 0;
}
}
diff -up ypbind-mt-1.20.4/src/ypbind-mt.c.nm ypbind-mt-1.20.4/src/ypbind-mt.c
--- ypbind-mt-1.20.4/src/ypbind-mt.c.nm 2010-04-15 14:04:29.869877527 +0200
+++ ypbind-mt-1.20.4/src/ypbind-mt.c 2010-04-15 14:27:54.874878127 +0200
@@ -765,9 +765,17 @@ main (int argc, char **argv)
BINDINGDIR, strerror (errno));
exit (1);
}
-
- if (!use_broadcast && (load_config (0) != 0))
- use_broadcast = 1;
+ /*
+ * Load config if we're not using DBUS/NetworkManager, since we
+ * assume the network is available now. If we're using NetworkManager,
+ * the config will be loaded when a network becomes available.
+ */
+ if (disable_dbus)
+ {
+ /* Load the configuration. If the load fails, set up broadcast mode. */
+ if (!use_broadcast && (load_config (0) != 0))
+ use_broadcast = 1;
+ }
if (use_broadcast)
add_server (domain, NULL, 0);