From: Bruno Haible Date: Mon, 26 Mar 2007 10:16:08 +0000 (+0000) Subject: If exists but is missing values, fill in the missing values. X-Git-Tag: cvs-readonly~661 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=af7308e5e6af8afd55c64386f23977070f8aa657;p=gnulib.git If exists but is missing values, fill in the missing values. --- diff --git a/ChangeLog b/ChangeLog index be91c01f8..61d5e88e9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,15 @@ 2007-03-25 Bruno Haible + * lib/sysexit_,h: If HAVE_SYSEXITS_H is defined, include the original + file, and only add EX_CONFIG. + * m4/sysexits.m4 (gl_SYSEXITS): If exists, check its + absolute file name and whether it is sufficient. Substitute also + HAVE_SYSEXITS_H and ABSOLUTE_SYSEXITS_H. + * modules/sysexits (Makefile.am): Substitute HAVE_SYSEXITS_H and + ABSOLUTE_SYSEXITS_H into sysexits.h. + +2007-03-25 Bruno Haible + * lib/getaddrinfo.c (getaddrinfo): Don't access hints->ai_flags when hints is NULL. diff --git a/lib/sysexit_.h b/lib/sysexit_.h index e5195155b..4f941e60f 100644 --- a/lib/sysexit_.h +++ b/lib/sysexit_.h @@ -1,5 +1,5 @@ /* exit() exit codes for some BSD system programs. - Copyright (C) 2003, 2006 Free Software Foundation, Inc. + Copyright (C) 2003, 2006-2007 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -20,22 +20,35 @@ #ifndef _SYSEXITS_H #define _SYSEXITS_H -#define EX_OK 0 /* same value as EXIT_SUCCESS */ - -#define EX_USAGE 64 -#define EX_DATAERR 65 -#define EX_NOINPUT 66 -#define EX_NOUSER 67 -#define EX_NOHOST 68 -#define EX_UNAVAILABLE 69 -#define EX_SOFTWARE 70 -#define EX_OSERR 71 -#define EX_OSFILE 72 -#define EX_CANTCREAT 73 -#define EX_IOERR 74 -#define EX_TEMPFAIL 75 -#define EX_PROTOCOL 76 -#define EX_NOPERM 77 -#define EX_CONFIG 78 +#if @HAVE_SYSEXITS_H@ + +# include @ABSOLUTE_SYSEXITS_H@ + +/* HP-UX 11 ends at EX_NOPERM. */ +# ifndef EX_CONFIG +# define EX_CONFIG 78 +# endif + +#else + +# define EX_OK 0 /* same value as EXIT_SUCCESS */ + +# define EX_USAGE 64 +# define EX_DATAERR 65 +# define EX_NOINPUT 66 +# define EX_NOUSER 67 +# define EX_NOHOST 68 +# define EX_UNAVAILABLE 69 +# define EX_SOFTWARE 70 +# define EX_OSERR 71 +# define EX_OSFILE 72 +# define EX_CANTCREAT 73 +# define EX_IOERR 74 +# define EX_TEMPFAIL 75 +# define EX_PROTOCOL 76 +# define EX_NOPERM 77 +# define EX_CONFIG 78 + +#endif #endif /* _SYSEXITS_H */ diff --git a/m4/sysexits.m4 b/m4/sysexits.m4 index 69d20917b..17d5aeef0 100644 --- a/m4/sysexits.m4 +++ b/m4/sysexits.m4 @@ -1,13 +1,45 @@ -# sysexits.m4 serial 2 -dnl Copyright (C) 2003,2005 Free Software Foundation, Inc. +# sysexits.m4 serial 3 +dnl Copyright (C) 2003, 2005, 2007 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_SYSEXITS], [ - AC_CHECK_HEADERS(sysexits.h, - [SYSEXITS_H=], - [SYSEXITS_H=sysexits.h]) + AC_CHECK_HEADERS_ONCE([sysexits.h]) + if test $ac_cv_header_sysexits_h = yes; then + HAVE_SYSEXITS_H=1 + gl_ABSOLUTE_HEADER([sysexits.h]) + ABSOLUTE_SYSEXITS_H=\"$gl_cv_absolute_sysexits_h\" + AC_TRY_COMPILE([#include ], + [switch (0) + { + case EX_OK: + case EX_USAGE: + case EX_DATAERR: + case EX_NOINPUT: + case EX_NOUSER: + case EX_NOHOST: + case EX_UNAVAILABLE: + case EX_SOFTWARE: + case EX_OSERR: + case EX_OSFILE: + case EX_CANTCREAT: + case EX_IOERR: + case EX_TEMPFAIL: + case EX_PROTOCOL: + case EX_NOPERM: + case EX_CONFIG: + break; + } + ], + [SYSEXITS_H=], + [SYSEXITS_H=sysexits.h]) + else + HAVE_SYSEXITS_H=0 + SYSEXITS_H=sysexits.h + fi + AC_SUBST([HAVE_SYSEXITS_H]) + AC_SUBST([ABSOLUTE_SYSEXITS_H]) AC_SUBST([SYSEXITS_H]) ]) diff --git a/modules/sysexits b/modules/sysexits index c979b9ede..e9e568844 100644 --- a/modules/sysexits +++ b/modules/sysexits @@ -17,7 +17,9 @@ BUILT_SOURCES += $(SYSEXITS_H) # doesn't have one that works with the given compiler. sysexits.h: sysexit_.h { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - cat $(srcdir)/sysexit_.h; \ + sed -e 's|@''HAVE_SYSEXITS_H''@|$(HAVE_SYSEXITS_H)|g' \ + -e 's|@''ABSOLUTE_SYSEXITS_H''@|$(ABSOLUTE_SYSEXITS_H)|g' \ + < $(srcdir)/sysexit_.h; \ } > $@-t mv -f $@-t $@ MOSTLYCLEANFILES += sysexits.h sysexits.h-t