summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorThomas Graf <tgraf@suug.ch>2011-03-24 20:14:52 (GMT)
committerThomas Graf <tgraf@suug.ch>2011-03-24 20:14:52 (GMT)
commitf523f297f7fed8b64fe4c2a6e3791d31b2d2448b (patch)
treeea26b71a71db31184f917cd3ce3d9ce609a6b5eb /include
parent8d5493418a5a82b5303722cd9b2964300813e693 (diff)
downloadlibnl-f523f297f7fed8b64fe4c2a6e3791d31b2d2448b.zip
libnl-f523f297f7fed8b64fe4c2a6e3791d31b2d2448b.tar.gz
libnl-f523f297f7fed8b64fe4c2a6e3791d31b2d2448b.tar.bz2
Allow NLSYSCONFDIR environment variable to overwrite built-in sysconfdir
Diffstat (limited to 'include')
-rw-r--r--include/netlink-local.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/netlink-local.h b/include/netlink-local.h
index 32e8302..9acc0e4 100644
--- a/include/netlink-local.h
+++ b/include/netlink-local.h
@@ -186,4 +186,16 @@ static inline int wait_for_ack(struct nl_sock *sk)
return nl_wait_for_ack(sk);
}
+static inline int build_sysconf_path(char **strp, const char *filename)
+{
+ char *sysconfdir;
+
+ sysconfdir = getenv("NLSYSCONFDIR");
+
+ if (!sysconfdir)
+ sysconfdir = SYSCONFDIR;
+
+ return asprintf(strp, "%s/%s", sysconfdir, filename);
+}
+
#endif