Check for dhclient binary availability
authorMarcel Holtmann <marcel@holtmann.org>
Fri, 19 Dec 2008 18:04:21 +0000 (19:04 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Fri, 19 Dec 2008 18:04:21 +0000 (19:04 +0100)
plugins/dhclient.c

index 06083b6..61dafe4 100644 (file)
@@ -23,6 +23,7 @@
 #include <config.h>
 #endif
 
+#include <unistd.h>
 #include <sys/wait.h>
 #include <glib/gstdio.h>
 
@@ -135,6 +136,9 @@ static int dhclient_probe(struct connman_element *element)
 
        DBG("element %p name %s", element, element->name);
 
+       if (access(DHCLIENT, X_OK) < 0)
+               return -errno;
+
        task = g_try_new0(struct dhclient_task, 1);
        if (task == NULL)
                return -ENOMEM;