From 2fad9ebd12e03a4be9d6f0227b32242287a8bec2 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Fri, 8 Jul 2011 17:03:17 -0700 Subject: [PATCH] dirs: Make sysconfdir available via ovs_sysconfdir(). This will be used in upcoming patches. --- lib/automake.mk | 1 + lib/dirs.c.in | 9 ++++++++- lib/dirs.h | 3 ++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/automake.mk b/lib/automake.mk index 8d93c7a1d..d55465bb6 100644 --- a/lib/automake.mk +++ b/lib/automake.mk @@ -263,6 +263,7 @@ lib/dirs.c: lib/dirs.c.in Makefile -e 's,[@]LOGDIR[@],"$(LOGDIR)",g' \ -e 's,[@]RUNDIR[@],"$(RUNDIR)",g' \ -e 's,[@]bindir[@],"$(bindir)",g' \ + -e 's,[@]sysconfdir[@],"$(sysconfdir)",g' \ -e 's,[@]pkgdatadir[@],"$(pkgdatadir)",g') \ > lib/dirs.c.tmp mv lib/dirs.c.tmp lib/dirs.c diff --git a/lib/dirs.c.in b/lib/dirs.c.in index a174ab386..5b6b8748a 100644 --- a/lib/dirs.c.in +++ b/lib/dirs.c.in @@ -1,6 +1,6 @@ #line 2 "@srcdir@/lib/dirs.c.in" /* - * Copyright (c) 2008, 2009, 2010 Nicira Networks. + * Copyright (c) 2008, 2009, 2010, 2011 Nicira Networks. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,6 +37,13 @@ get_dir(struct directory *d) return d->value; } +const char * +ovs_sysconfdir(void) +{ + static struct directory d = { NULL, @sysconfdir@, "OVS_SYSCONFDIR" }; + return get_dir(&d); +} + const char * ovs_pkgdatadir(void) { diff --git a/lib/dirs.h b/lib/dirs.h index 303530598..57107ff50 100644 --- a/lib/dirs.h +++ b/lib/dirs.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010 Nicira Networks. + * Copyright (c) 2008, 2009, 2010, 2011 Nicira Networks. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,6 +17,7 @@ #ifndef DIRS_H #define DIRS_H 1 +const char *ovs_sysconfdir(void); /* /usr/local/etc */ const char *ovs_pkgdatadir(void); /* /usr/local/share/openvswitch */ const char *ovs_rundir(void); /* /usr/local/var/run/openvswitch */ const char *ovs_logdir(void); /* /usr/local/var/log/openvswitch */ -- 2.43.0