summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2011-06-03 08:49:03 +0200
committerMarcel Holtmann <marcel@holtmann.org>2011-06-03 08:49:03 +0200
commitd573a3a57ceaf3a10e0f15e52e7e561ad50405d0 (patch)
tree54000e08409b414cfd1a5dae2c3469c23d764a81 /tools
parent99d9f86bd4ce207b2567b91a119c898454a344b6 (diff)
tools: Use mobile-broadband-provider-info database location if present
Diffstat (limited to 'tools')
-rw-r--r--tools/lookup-apn.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/lookup-apn.c b/tools/lookup-apn.c
index 0b8a8313..5239b65d 100644
--- a/tools/lookup-apn.c
+++ b/tools/lookup-apn.c
@@ -33,8 +33,10 @@
#include <glib.h>
-#define PROVIDER_DB "/usr/share/" \
- "mobile-broadband-provider-info/serviceproviders.xml"
+#ifndef PROVIDER_DATABASE
+#define PROVIDER_DATABASE "/usr/share/mobile-broadband-provider-info" \
+ "serviceproviders.xml"
+#endif
static gboolean match_found;
static const char *current_element;
@@ -151,7 +153,7 @@ static int lookup_apn(const char *mcc, const char *mnc, const char *spn)
if (mcc == NULL || mnc == NULL)
return -1;
- fd = open(PROVIDER_DB, O_RDONLY);
+ fd = open(PROVIDER_DATABASE, O_RDONLY);
if (fd < 0)
return -1;