diff options
author | Nick Alcock <nick.alcock@oracle.com> | 2014-10-03 13:54:09 +0100 |
---|---|---|
committer | Andreas Gruenbacher <agruen@linbit.com> | 2014-10-20 12:10:52 +0200 |
commit | c4a7fdbcc109d6e8b465a427c714926fcb85c750 (patch) | |
tree | 5d5133baa8fc566e272daa3028285ed48089594a | |
parent | 55f39ef1ddec924d746d96cbe5bdc1030eeff92b (diff) | |
download | attr-c4a7fdbcc109d6e8b465a427c714926fcb85c750.tar.gz |
build: unbreak attr_copy_fd() and attr_copy_file().
Mike's build-system-revamping commit 9ce21bd of January this year
accidentally dropped a crucial -include of "libattr.h". This silently
undefined the HAVE_F*ATTR macros, causing attr_copy_{fd,file}.c to think
that xattrs are not supported and to compile the functions in those
files into a 'return 0;' stub.
The code in these files uses the NLS _() macro, which was recently moved
into misc.h, which can only sensibly be included by things outside
libattr. So migrate the NLS macros into a new nls.h at the same time,
and include it from misc.h.
With these fixes in place, xattrs can be copied again.
-rw-r--r-- | include/Makemodule.am | 1 | ||||
-rw-r--r-- | include/misc.h | 10 | ||||
-rw-r--r-- | include/nls.h | 9 | ||||
-rw-r--r-- | libattr/Makemodule.am | 1 | ||||
-rw-r--r-- | libattr/attr_copy_fd.c | 1 | ||||
-rw-r--r-- | libattr/attr_copy_file.c | 1 |
6 files changed, 14 insertions, 9 deletions
diff --git a/include/Makemodule.am b/include/Makemodule.am index c43e2e4..e2017c5 100644 --- a/include/Makemodule.am +++ b/include/Makemodule.am @@ -6,4 +6,5 @@ pkginclude_HEADERS += \ noinst_HEADERS += \ include/misc.h \ + include/nls.h \ include/walk_tree.h diff --git a/include/misc.h b/include/misc.h index 3bab7de..8b8ec48 100644 --- a/include/misc.h +++ b/include/misc.h @@ -22,12 +22,4 @@ extern char *unquote(char *str); extern char *next_line(FILE *file); -#ifdef ENABLE_NLS -# include <libintl.h> -# define _(x) gettext(x) -#else -# define _(x) (x) -# define textdomain(d) do { } while (0) -# define bindtextdomain(d,dir) do { } while (0) -#endif -#include <locale.h> +#include "nls.h" diff --git a/include/nls.h b/include/nls.h new file mode 100644 index 0000000..06f84bb --- /dev/null +++ b/include/nls.h @@ -0,0 +1,9 @@ +#ifdef ENABLE_NLS +# include <libintl.h> +# define _(x) gettext(x) +#else +# define _(x) (x) +# define textdomain(d) do { } while (0) +# define bindtextdomain(d,dir) do { } while (0) +#endif +#include <locale.h> diff --git a/libattr/Makemodule.am b/libattr/Makemodule.am index 7e06e8e..5c888f0 100644 --- a/libattr/Makemodule.am +++ b/libattr/Makemodule.am @@ -17,6 +17,7 @@ libattr_la_SOURCES = \ libattr/libattr.c \ libattr/libattr.h \ libattr/syscalls.c +libattr_la_CFLAGS = -include libattr/libattr.h libattr_la_LDFLAGS = \ -Wl,--version-script,$(top_srcdir)/exports \ -version-info $(LTVERSION) diff --git a/libattr/attr_copy_fd.c b/libattr/attr_copy_fd.c index 14b7368..a21e8c2 100644 --- a/libattr/attr_copy_fd.c +++ b/libattr/attr_copy_fd.c @@ -40,6 +40,7 @@ #define ERROR_CONTEXT_MACROS #include "error_context.h" +#include "nls.h" #if !defined(ENOTSUP) # define ENOTSUP (-1) diff --git a/libattr/attr_copy_file.c b/libattr/attr_copy_file.c index 2efc224..9132433 100644 --- a/libattr/attr_copy_file.c +++ b/libattr/attr_copy_file.c @@ -40,6 +40,7 @@ #define ERROR_CONTEXT_MACROS #include "error_context.h" +#include "nls.h" #if !defined(ENOTSUP) # define ENOTSUP (-1) |