[ovs-dev] [ovsdb-locks 03/11] dirs: Make sysconfdir available via ovs_sysconfdir().
Ethan Jackson
ethan at nicira.com
Mon Jul 25 21:33:35 UTC 2011
Looks good.
Ethan
On Thu, Jul 14, 2011 at 14:27, Ben Pfaff <blp at nicira.com> wrote:
> 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 e3d7c3f..6bd7e39 100644
> --- a/lib/automake.mk
> +++ b/lib/automake.mk
> @@ -261,6 +261,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 a174ab3..5b6b874 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.
> @@ -38,6 +38,13 @@ get_dir(struct directory *d)
> }
>
> const char *
> +ovs_sysconfdir(void)
> +{
> + static struct directory d = { NULL, @sysconfdir@, "OVS_SYSCONFDIR" };
> + return get_dir(&d);
> +}
> +
> +const char *
> ovs_pkgdatadir(void)
> {
> static struct directory d = { NULL, @pkgdatadir@, "OVS_PKGDATADIR" };
> diff --git a/lib/dirs.h b/lib/dirs.h
> index 3035305..57107ff 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 */
> --
> 1.7.4.4
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
>
More information about the dev
mailing list