summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2010-07-09 18:05:41 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2010-07-09 18:11:12 +0200
commit6877508042fec2f80b5340981edb728a0c715725 (patch)
tree961c584ed106d2067e9490c47b1befa2584e7694 /scripts
parente582990bb82c9b76c67e3c3121d6c7c3c2739b92 (diff)
downloadconnman-6877508042fec2f80b5340981edb728a0c715725.tar.gz
connman-6877508042fec2f80b5340981edb728a0c715725.tar.bz2
connman-6877508042fec2f80b5340981edb728a0c715725.zip
Convert udhcp plugin to connman task
The udhcp plugin was still using the old and deprecated plugins/task.c API.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/udhcpc-script.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/scripts/udhcpc-script.c b/scripts/udhcpc-script.c
index a3f3b214..5d417b59 100644
--- a/scripts/udhcpc-script.c
+++ b/scripts/udhcpc-script.c
@@ -39,6 +39,7 @@ int main(int argc, char *argv[])
DBusMessage *msg;
char *busname, *interface, *address, *netmask, *broadcast;
char *gateway, *dns;
+ char *path;
if (argc < 2)
return 0;
@@ -50,6 +51,10 @@ int main(int argc, char *argv[])
interface = getenv("interface");
+ path = getenv("PATH");
+ if (path == NULL)
+ path = "";
+
address = getenv("ip");
if (address == NULL)
address = "";
@@ -82,8 +87,9 @@ int main(int argc, char *argv[])
return 0;
}
- msg = dbus_message_new_method_call(busname, UDHCPC_PATH,
- UDHCPC_INTF, argv[1]);
+ msg = dbus_message_new_method_call(busname, path,
+ "org.moblin.connman.Task",
+ "Notify");
if (msg == NULL) {
dbus_connection_unref(conn);
fprintf(stderr, "Failed to allocate method call\n");
@@ -98,6 +104,7 @@ int main(int argc, char *argv[])
DBUS_TYPE_STRING, &broadcast,
DBUS_TYPE_STRING, &gateway,
DBUS_TYPE_STRING, &dns,
+ DBUS_TYPE_STRING, &argv[1],
DBUS_TYPE_INVALID);
if (dbus_connection_send(conn, msg, NULL) == FALSE)