+2004-01-23 Paul Eggert <eggert@twinsun.com>
+
+ * modules/argmatch, modules/obstack, modules/xstrtol:
+ Depend on exitfail.
+
2004-01-20 Bruno Haible <bruno@clisp.org>
* modules/setenv: Depend on allocsa instead of alloca.
+2004-01-23 Paul Eggert <eggert@twinsun.com>
+
+ Exit-status fix from coreutils.
+
+ Use exit_failure consistently in place of EXIT_FAILURE,
+ so that program exit statuses are consistent on failure.
+
+ * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
+ Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
+ * argmatch.h: Comment fix to match the above.
+ * obstack.c (obstack_exit_failure) [!defined _LIBC]:
+ Now a macro referring to exit_failure, instead of a separate
+ variable. Include "exitfail.h" to get it.
+ * xstrtol.h: Include "exitfail.h".
+ (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
+
+ * long-options.c (parse_long_options): Use prototype
+ for usage function arg. Pass it EXIT_SUCCESS rather than 0,
+ for clarity.
+
2004-01-21 Jim Meyering <jim@meyering.net>
* mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
* timegm.c (__mktime_internal) [!_LIBC]: Likewise.
Problem building statically-linked `ls' reported by Michael Brunnbauer.
+2004-01-18 Paul Eggert <eggert@twinsun.com>
+
+ Merge from diffutils.
+
+ * file-type.c (file_type): Add typed memory objects.
+ * file-type.h (S_TYPEISTMO): New macro.
+
+ * c-stack.h (c_stack_action): Remove argv argument.
+ * c-stack.c (c_stack_action): Likewise. All uses changed.
+ (die): Don't calculate message unless segv_action returns.
+ (get_stack_location, min_address_from_argv, max_address_from_argv,
+ volatile stack_base, volatile_stack_size): Remove.
+ (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
+ that every segmentation violation is a stack overflow. (Ouch!)
+ See Debian bug 136249 (still outstanding) for more info about why
+ HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
+
2003-11-30 Bruno Haible <bruno@clisp.org>
Safer stack allocation.
/* argmatch.c -- find a match for a string in an array
- Copyright (C) 1990, 1998, 1999, 2001, 2002, 2003 Free Software
- Foundation, Inc.
+ Copyright (C) 1990, 1998, 1999, 2001, 2002, 2003, 2004 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
/* Non failing version of argmatch call this function after failing. */
#ifndef ARGMATCH_DIE
-# define ARGMATCH_DIE exit (EXIT_FAILURE)
+# include "exitfail.h"
+# define ARGMATCH_DIE exit (exit_failure)
#endif
#ifdef ARGMATCH_DIE_DECL
/* argmatch.h -- definitions and prototypes for argmatch.c
- Copyright (C) 1990, 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+
+ Copyright (C) 1990, 1998, 1999, 2001, 2002, 2004 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
/* xargmatch calls this function when it fails. This function should not
return. By default, this is a function that calls ARGMATCH_DIE which
- in turn defaults to `exit (EXIT_FAILURE)'. */
+ in turn defaults to `exit (exit_failure)'. */
typedef void (*argmatch_exit_fn) (void);
extern argmatch_exit_fn argmatch_die;
/* Utility to accept --help and --version options as unobtrusively as possible.
- Copyright (C) 1993, 1994, 1998, 1999, 2000, 2002, 2003 Free
+ Copyright (C) 1993, 1994, 1998, 1999, 2000, 2002, 2003, 2004 Free
Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
const char *command_name,
const char *package,
const char *version,
- void (*usage_func)(),
+ void (*usage_func) (int),
/* const char *author1, ...*/ ...)
{
int c;
switch (c)
{
case 'h':
- (*usage_func) (0);
+ (*usage_func) (EXIT_SUCCESS);
case 'v':
{
/* obstack.c - subroutines used implicitly by object stack macros
Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1996, 1997,
- 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+ 1998, 1999, 2000, 2001, 2002, 2003, 2004 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
#endif
#ifdef _LIBC
-#include <obstack.h>
+# include <obstack.h>
#else
-#include "obstack.h"
+# include "obstack.h"
#endif
/* NOTE BEFORE MODIFYING THIS FILE: This version number must be
/* Exit value used when `print_and_abort' is used. */
# include <stdlib.h>
-# ifndef _LIBC
-# include "exit.h"
-# endif
+# ifdef _LIBC
int obstack_exit_failure = EXIT_FAILURE;
+# else
+# include "exitfail.h"
+# define obstack_exit_failure exit_failure
+# endif
/* The non-GNU-C macros copy the obstack into this global variable
to avoid multiple evaluation. */
/* The new chunk certainly contains no empty object yet. */
h->maybe_empty_object = 0;
}
-#ifdef _LIBC
+# ifdef _LIBC
libc_hidden_def (_obstack_newchunk)
-#endif
+# endif
/* Return nonzero if object OBJ has been allocated from obstack H.
This is here for debugging.
abort ();
}
-#ifdef _LIBC
+# ifdef _LIBC
/* Older versions of libc used a function _obstack_free intended to be
called by non-GCC compilers. */
strong_alias (obstack_free, _obstack_free)
-#endif
+# endif
\f
int
_obstack_memory_used (struct obstack *h)
/* A more useful interface to strtol.
- Copyright (C) 1995, 1996, 1998, 1999, 2001, 2002, 2003 Free
+ Copyright (C) 1995, 1996, 1998, 1999, 2001, 2002, 2003, 2004 Free
Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
#ifndef XSTRTOL_H_
# define XSTRTOL_H_ 1
+# include "exitfail.h"
+
/* Get uintmax_t. */
# if HAVE_INTTYPES_H
# include <inttypes.h>
while (0)
# define STRTOL_FATAL_ERROR(Str, Argument_type_string, Err) \
- _STRTOL_ERROR (2, Str, Argument_type_string, Err)
+ _STRTOL_ERROR (exit_failure, Str, Argument_type_string, Err)
# define STRTOL_FAIL_WARN(Str, Argument_type_string, Err) \
_STRTOL_ERROR (0, Str, Argument_type_string, Err)
quote
unlocked-io
exit
+exitfail
configure.ac:
Depends-on:
gettext
exit
+exitfail
configure.ac:
gl_OBSTACK
m4/xstrtol.m4
Depends-on:
+exitfail
configure.ac:
gl_XSTRTOL