summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJan Alexander Steffens <jan.steffens@gmail.com>2013-05-13 07:10:00 -0400
committerDan Winship <danw@gnome.org>2014-01-03 14:51:16 -0500
commit691422a460166cbe5eb6fe37258fecd2b2c101cf (patch)
treee5ecc80a850890b93d694221a702a6243cfcb8e9 /src
parentc4edeb6da487740610c4f798c76e0f71c9df1e85 (diff)
downloadNetworkManager-691422a460166cbe5eb6fe37258fecd2b2c101cf.tar.gz
build: add --with-dnsmasq, to specify dnsmasq path
https://bugzilla.gnome.org/show_bug.cgi?id=700219
Diffstat (limited to 'src')
-rw-r--r--src/dns-manager/nm-dns-dnsmasq.c3
-rw-r--r--src/dnsmasq-manager/nm-dnsmasq-manager.c4
2 files changed, 4 insertions, 3 deletions
diff --git a/src/dns-manager/nm-dns-dnsmasq.c b/src/dns-manager/nm-dns-dnsmasq.c
index 23f46e9de1..8367693da7 100644
--- a/src/dns-manager/nm-dns-dnsmasq.c
+++ b/src/dns-manager/nm-dns-dnsmasq.c
@@ -54,6 +54,7 @@ static inline const char *
find_dnsmasq (void)
{
static const char *paths[] = {
+ DNSMASQ_PATH,
"/usr/local/sbin/dnsmasq",
"/usr/sbin/dnsmasq",
"/sbin/dnsmasq",
@@ -62,7 +63,7 @@ find_dnsmasq (void)
const char **binary = paths;
while (*binary != NULL) {
- if (g_file_test (*binary, G_FILE_TEST_EXISTS))
+ if (**binary && g_file_test (*binary, G_FILE_TEST_EXISTS))
return *binary;
binary++;
}
diff --git a/src/dnsmasq-manager/nm-dnsmasq-manager.c b/src/dnsmasq-manager/nm-dnsmasq-manager.c
index 5ad6b005d1..fb1a367c99 100644
--- a/src/dnsmasq-manager/nm-dnsmasq-manager.c
+++ b/src/dnsmasq-manager/nm-dnsmasq-manager.c
@@ -169,16 +169,16 @@ static inline const char *
nm_find_dnsmasq (void)
{
static const char *dnsmasq_binary_paths[] = {
+ DNSMASQ_PATH,
"/usr/local/sbin/dnsmasq",
"/usr/sbin/dnsmasq",
"/sbin/dnsmasq",
NULL
};
-
const char **dnsmasq_binary = dnsmasq_binary_paths;
while (*dnsmasq_binary != NULL) {
- if (g_file_test (*dnsmasq_binary, G_FILE_TEST_EXISTS))
+ if (**dnsmasq_binary && g_file_test (*dnsmasq_binary, G_FILE_TEST_EXISTS))
break;
dnsmasq_binary++;
}