X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=scripts%2Fdhclient-script.c;h=bf2316d0931240b4b78855b1e8dcdff006b30bbc;hb=2be69ed5050ac7bfa03af2ddce172e6fc02ddc84;hp=70687fd207538927e91eb6e726741f592da9f7d4;hpb=249a12194decb4b7a06d717bcd5284d1467e759b;p=connman diff --git a/scripts/dhclient-script.c b/scripts/dhclient-script.c index 70687fd..bf2316d 100644 --- a/scripts/dhclient-script.c +++ b/scripts/dhclient-script.c @@ -29,6 +29,9 @@ #include +#define DHCLIENT_INTF "org.isc.dhclient" +#define DHCLIENT_PATH "/org/isc/dhclient" + extern char **environ; static void append(DBusMessageIter *dict, const char *pattern) @@ -80,8 +83,8 @@ int main(int argc, char *argv[]) return 0; } - msg = dbus_message_new_method_call(busname, "/org/isc/dhclient", - "org.isc.dhclient", "notify"); + msg = dbus_message_new_method_call(busname, DHCLIENT_PATH, + DHCLIENT_INTF, "notify"); if (msg == NULL) { dbus_connection_unref(conn); fprintf(stderr, "Failed to allocate method call\n"); @@ -115,6 +118,8 @@ int main(int argc, char *argv[]) if (dbus_connection_send(conn, msg, NULL) == FALSE) fprintf(stderr, "Failed to send message\n"); + dbus_connection_flush(conn); + dbus_message_unref(msg); dbus_connection_unref(conn);