findutils-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] maint: go back to using 'error'


From: Bernhard Voelker
Subject: [PATCH] maint: go back to using 'error'
Date: Sat, 30 Sep 2023 15:10:22 +0200

Now that Gnulib's 'error' module does proper static checking
for not returning, we need no longer use the 'die' macro.
This makes code easier to read for people that are used to 'error'.

* cfg.mk (sc_die_EXIT_FAILURE): Remove.
* src/die.h: Remove.  All includes removed.  All calls to 'die'
changed back to calls to 'error'.
* lib/Makefile.am (libfind_a_SOURCES): Remove 'die.h'.
* src/system.h: Include error.h.  Stop including error.h elsewhere.
* find/ftsfind.c (process_all_startpoints): Avoid extra '\n' in error
diagnostics wrt/ -files0-from.  Also avoid redundant "%s" formats.
* find/parser.c (parse_perm, parse_regex):
* lib/buildcmd.c (bc_push_arg):
Wrap calls to 'error' in block when under an if-condition and either
the if-condition or the 'error' invocation is spanning over more
than one line.
* find/tree.c (get_pred_cost): Make error message translatable - found
by sc_unmarked_diagnostics.
---
 cfg.mk           |  11 ---
 find/exec.c      |  10 +-
 find/fstype.c    |   3 +-
 find/ftsfind.c   |  35 ++++---
 find/parser.c    | 248 ++++++++++++++++++++++++-----------------------
 find/pred.c      |   4 +-
 find/print.c     |  14 ++-
 find/tree.c      |  92 +++++++++---------
 find/util.c      |  46 +++++----
 lib/Makefile.am  |   3 +-
 lib/buildcmd.c   |  25 ++---
 lib/die.h        |  32 ------
 lib/fdleak.c     |   1 -
 lib/listfile.c   |   4 +-
 lib/regextype.c  |   9 +-
 lib/safe-atoi.c  |  17 ++--
 lib/system.h     |   2 +
 locate/frcode.c  |  26 +++--
 locate/locate.c  |  46 +++++----
 locate/word_io.c |   8 +-
 xargs/xargs.c    | 116 +++++++++++-----------
 21 files changed, 345 insertions(+), 407 deletions(-)
 delete mode 100644 lib/die.h

diff --git a/cfg.mk b/cfg.mk
index a98c2f99..652f55f0 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -132,17 +132,6 @@ sc_prohibit_colon_redirection:
               exit 1; }  \
          || :
 
-# Usage of error() with an exit constant, should instead use die(),
-# as that avoids warnings and may generate better code, due to being apparent
-# to the compiler that it doesn't return.
-sc_die_EXIT_FAILURE:
-       @cd $(srcdir) \
-         && GIT_PAGER= git grep -E 'error \(.*_(FAILURE|INVALID)' \
-              -- find lib locate xargs \
-         && { echo '$(ME): '"Use die() instead of error" 1>&2; \
-              exit 1; }  \
-         || :
-
 sc_prohibit-skip:
        @prohibit='\|\| skip ' \
        halt='Use skip_ not skip' \
diff --git a/find/exec.c b/find/exec.c
index c9cda8af..f7241ff6 100644
--- a/find/exec.c
+++ b/find/exec.c
@@ -29,7 +29,6 @@
 /* gnulib headers */
 #include "cloexec.h"
 #include "dirname.h"
-#include "error.h"
 #include "fcntl--.h"
 #include "save-cwd.h"
 #include "xalloc.h"
@@ -37,7 +36,6 @@
 /* findutils headers */
 #include "buildcmd.h"
 #include "defs.h"
-#include "die.h"
 #include "fdleak.h"
 #include "system.h"
 
@@ -119,9 +117,9 @@ impl_pred_exec (const char *pathname,
       */
       if (!record_exec_dir (execp))
         {
-          die (EXIT_FAILURE, errno,
-               _("Failed to save working directory in order to "
-                 "run a command on %s"),
+          error (EXIT_FAILURE, errno,
+                 _("Failed to save working directory in order to "
+                   "run a command on %s"),
                  safely_quote_err_filename (0, pathname));
           /*NOTREACHED*/
         }
@@ -314,7 +312,7 @@ launch (struct buildcmd_control *ctl, void *usercontext, 
int argc, char **argv)
 
   child_pid = fork ();
   if (child_pid == -1)
-    die (EXIT_FAILURE, errno, _("cannot fork"));
+    error (EXIT_FAILURE, errno, _("cannot fork"));
   if (child_pid == 0)
     {
       /* We are the child. */
diff --git a/find/fstype.c b/find/fstype.c
index 47f1ff71..c6346b14 100644
--- a/find/fstype.c
+++ b/find/fstype.c
@@ -54,7 +54,6 @@
 
 /* find headers. */
 #include "defs.h"
-#include "die.h"
 #include "extendbuf.h"
 #include "system.h"
 
@@ -237,7 +236,7 @@ file_system_type_uncached (const struct stat *statp, const 
char *path,
        * use because gnulib has abstracted all that stuff away.
        * Hence we cannot issue a specific error message here.
        */
-      die (EXIT_FAILURE, 0, _("Cannot read mounted file system list"));
+      error (EXIT_FAILURE, 0, _("Cannot read mounted file system list"));
     }
   for (type=NULL, entry=entries; entry; entry=entry->me_next)
     {
diff --git a/find/ftsfind.c b/find/ftsfind.c
index 24f1e59e..27337d5d 100644
--- a/find/ftsfind.c
+++ b/find/ftsfind.c
@@ -41,7 +41,6 @@
 #include "argv-iter.h"
 #include "cloexec.h"
 #include "closeout.h"
-#include "error.h"
 #include "fts_.h"
 #include "intprops.h"
 #include "progname.h"
@@ -53,7 +52,6 @@
 
 /* find headers. */
 #include "defs.h"
-#include "die.h"
 #include "dircallback.h"
 #include "fdleak.h"
 #include "unused-result.h"
@@ -580,7 +578,7 @@ process_all_startpoints (int argc, char *argv[])
       if (argv_starting_points)
         {
           error (0, 0, _("extra operand %s"), safely_quote_err_filename (0, 
argv[0]));
-          die (EXIT_FAILURE, 0, "%s",
+          error (EXIT_FAILURE, 0,
                    _("file operands cannot be combined with -files0-from"));
         }
 
@@ -591,9 +589,9 @@ process_all_startpoints (int argc, char *argv[])
            * mess with stdin.  */
           if (options.ok_prompt_stdin)
             {
-              die (EXIT_FAILURE, 0, "%s\n",
-                   _("option -files0-from reading from standard input"
-                   " cannot be combined with -ok, -okdir"));
+              error (EXIT_FAILURE, 0,
+                     _("option -files0-from reading from standard input"
+                       " cannot be combined with -ok, -okdir"));
             }
           files0_filename_quoted = safely_quote_err_filename (0, _("(standard 
input)"));
           stream = stdin;
@@ -603,8 +601,10 @@ process_all_startpoints (int argc, char *argv[])
           files0_filename_quoted = safely_quote_err_filename (0, 
options.files0_from);
           stream = fopen (options.files0_from, "r");
           if (stream == NULL)
-            die (EXIT_FAILURE, errno, _("cannot open %s for reading"),
-                 files0_filename_quoted);
+            {
+              error (EXIT_FAILURE, errno, _("cannot open %s for reading"),
+                     files0_filename_quoted);
+            }
 
           const int fd = fileno (stream);
           assert (fd >= 0);
@@ -621,10 +621,11 @@ process_all_startpoints (int argc, char *argv[])
               if (fstat (fd, &sb1) == 0 && fstat (STDIN_FILENO, &sb2) == 0
                     && SAME_INODE (sb1, sb2))
                 {
-                  die (EXIT_FAILURE, 0, "%s: %s\n",
-                           _("option -files0-from: standard input must not 
refer"
-                             " to the same file when combined with -ok, 
-okdir"),
-                           files0_filename_quoted);
+                  error (EXIT_FAILURE, 0,
+                         _("option -files0-from: standard input must not refer"
+                           " to the same file when combined with -ok, -okdir:"
+                           " %s"),
+                         files0_filename_quoted);
                 }
             }
           set_cloexec_flag (fd, true);
@@ -716,7 +717,7 @@ process_all_startpoints (int argc, char *argv[])
   argv_iter_free (ai);
 
   if (ok && options.files0_from && (ferror (stream) || fclose (stream) != 0))
-    die (EXIT_FAILURE, 0, _("error reading %s"), files0_filename_quoted);
+    error (EXIT_FAILURE, 0, _("error reading %s"), files0_filename_quoted);
 
   return ok;
 }
@@ -750,8 +751,8 @@ main (int argc, char **argv)
   state.shared_files = sharefile_init ("w");
   if (NULL == state.shared_files)
     {
-      die (EXIT_FAILURE, errno,
-          _("Failed to initialize shared-file hash table"));
+      error (EXIT_FAILURE, errno,
+            _("Failed to initialize shared-file hash table"));
     }
 
   /* Set the option defaults before we do the locale initialisation as
@@ -766,9 +767,7 @@ main (int argc, char **argv)
   bindtextdomain (PACKAGE, LOCALEDIR);
   textdomain (PACKAGE);
   if (atexit (close_stdout))
-    {
-      die (EXIT_FAILURE, errno, _("The atexit library function failed"));
-    }
+    error (EXIT_FAILURE, errno, _("The atexit library function failed"));
 
   /* Check for -P, -H or -L options.  Also -D and -O, which are
    * both GNU extensions.
diff --git a/find/parser.c b/find/parser.c
index 76cb71bf..a6ee520c 100644
--- a/find/parser.c
+++ b/find/parser.c
@@ -32,7 +32,6 @@
 
 
 /* gnulib headers. */
-#include "error.h"
 #include "fnmatch.h"
 #include "fts_.h"
 #include "modechange.h"
@@ -62,7 +61,6 @@
 /* find headers. */
 #include "buildcmd.h"
 #include "defs.h"
-#include "die.h"
 #include "fdleak.h"
 #include "findutils-version.h"
 #include "system.h"
@@ -452,11 +450,11 @@ check_option_combinations (const struct predicate *p)
       if (!options.explicit_depth)
        {
          /* This fixes Savannah bug #20865. */
-         die (EXIT_FAILURE, 0,
-              _("The -delete action automatically turns on -depth, "
-                "but -prune does nothing when -depth is in effect.  "
-                "If you want to carry on anyway, just explicitly use "
-                "the -depth option."));
+         error (EXIT_FAILURE, 0,
+                _("The -delete action automatically turns on -depth, "
+                  "but -prune does nothing when -depth is in effect.  "
+                  "If you want to carry on anyway, just explicitly use "
+                  "the -depth option."));
        }
     }
 }
@@ -1164,12 +1162,12 @@ parse_group (const struct parser_table* entry, char 
**argv, int *arg_ptr)
              else
                {
                  /* XXX: no test in test suite for this */
-                 die (EXIT_FAILURE, 0,
-                      _("%s is not the name of an existing group and"
-                        " it does not look like a numeric group ID "
-                        "because it has the unexpected suffix %s"),
-                      quotearg_n_style (0, options.err_quoting_style, 
groupname),
-                      quotearg_n_style (1, options.err_quoting_style, 
groupname+gid_len));
+                 error (EXIT_FAILURE, 0,
+                        _("%s is not the name of an existing group and"
+                          " it does not look like a numeric group ID "
+                          "because it has the unexpected suffix %s"),
+                        quotearg_n_style (0, options.err_quoting_style, 
groupname),
+                        quotearg_n_style (1, options.err_quoting_style, 
groupname+gid_len));
                  *arg_ptr = saved_argc; /* don't consume the invalid argument. 
*/
                  return false;
                }
@@ -1179,14 +1177,14 @@ parse_group (const struct parser_table* entry, char 
**argv, int *arg_ptr)
              if (*groupname)
                {
                  /* XXX: no test in test suite for this */
-                 die (EXIT_FAILURE, 0,
-                      _("%s is not the name of an existing group"),
-                      quotearg_n_style (0, options.err_quoting_style, 
groupname));
+                 error (EXIT_FAILURE, 0,
+                        _("%s is not the name of an existing group"),
+                        quotearg_n_style (0, options.err_quoting_style, 
groupname));
                }
              else
                {
-                 die (EXIT_FAILURE, 0,
-                      _("argument to -group is empty, but should be a group 
name"));
+                 error (EXIT_FAILURE, 0,
+                        _("argument to -group is empty, but should be a group 
name"));
                }
              *arg_ptr = saved_argc; /* don't consume the invalid argument. */
              return false;
@@ -1258,8 +1256,8 @@ fnmatch_sanitycheck (void)
          || 0 == fnmatch ("Foo", "foo", 0)
          || 0 != fnmatch ("Foo", "foo", FNM_CASEFOLD))
        {
-         die (EXIT_FAILURE, 0,
-              _("sanity check of the fnmatch() library function failed."));
+         error (EXIT_FAILURE, 0,
+                _("sanity check of the fnmatch() library function failed."));
          return false;
        }
       checked = true;
@@ -1387,10 +1385,10 @@ insert_depthspec (const struct parser_table* entry, 
char **argv, int *arg_ptr,
              return parse_noop (entry, argv, arg_ptr);
            }
        }
-      die (EXIT_FAILURE, 0,
-          _("Expected a positive decimal integer argument to %s, but got %s"),
-          predicate,
-          quotearg_n_style (0, options.err_quoting_style, depthstr));
+      error (EXIT_FAILURE, 0,
+            _("Expected a positive decimal integer argument to %s, but got 
%s"),
+            predicate,
+            quotearg_n_style (0, options.err_quoting_style, depthstr));
       /* NOTREACHED */
       return false;
     }
@@ -1568,8 +1566,8 @@ parse_newerXY (const struct parser_table* entry, char 
**argv, int *arg_ptr)
           */
          if (argv[1+*arg_ptr] == NULL)
            {
-             die (EXIT_FAILURE, 0, _("The %s test needs an argument"),
-                  quotearg_n_style (0, options.err_quoting_style, 
argv[*arg_ptr]));
+             error (EXIT_FAILURE, 0, _("The %s test needs an argument"),
+                    quotearg_n_style (0, options.err_quoting_style, 
argv[*arg_ptr]));
            }
          else
            {
@@ -1604,9 +1602,9 @@ parse_newerXY (const struct parser_table* entry, char 
**argv, int *arg_ptr)
                                   argv[*arg_ptr],
                                   &options.start_time))
                {
-                 die (EXIT_FAILURE, 0,
-                      _("I cannot figure out how to interpret %s as a date or 
time"),
-                      quotearg_n_style (0, options.err_quoting_style, 
argv[*arg_ptr]));
+                 error (EXIT_FAILURE, 0,
+                        _("I cannot figure out how to interpret %s as a date 
or time"),
+                        quotearg_n_style (0, options.err_quoting_style, 
argv[*arg_ptr]));
                }
            }
          else
@@ -1621,9 +1619,9 @@ parse_newerXY (const struct parser_table* entry, char 
**argv, int *arg_ptr)
              if (!get_stat_Ytime (&stat_newer, y, &our_pred->args.reftime.ts))
                {
                  /* We cannot extract a timestamp from the struct stat. */
-                 die (EXIT_FAILURE, 0,
-                      _("Cannot obtain birth time of file %s"),
-                      safely_quote_err_filename (0, argv[*arg_ptr]));
+                 error (EXIT_FAILURE, 0,
+                        _("Cannot obtain birth time of file %s"),
+                        safely_quote_err_filename (0, argv[*arg_ptr]));
                }
            }
          our_pred->args.reftime.kind = COMP_GT;
@@ -1861,8 +1859,10 @@ parse_perm (const struct parser_table* entry, char 
**argv, int *arg_ptr)
      and it would be confusing if 'find' continued to support it.  */
   if (NULL == change
       || (perm_expr[0] == '+' && '0' <= perm_expr[1] && perm_expr[1] < '8'))
-    die (EXIT_FAILURE, 0, _("invalid mode %s"),
-        quotearg_n_style (0, options.err_quoting_style, perm_expr));
+    {
+      error (EXIT_FAILURE, 0, _("invalid mode %s"),
+            quotearg_n_style (0, options.err_quoting_style, perm_expr));
+    }
   perm_val[0] = mode_adjust (0, false, 0, change, NULL);
   perm_val[1] = mode_adjust (0, true, 0, change, NULL);
   free (change);
@@ -2051,9 +2051,11 @@ insert_regex (char **argv,
 
       error_message = re_compile_pattern (rx, strlen (rx), re);
       if (error_message)
-        die (EXIT_FAILURE, 0,
-            _("failed to compile regular expression '%s': %s"),
-            rx, error_message);
+        {
+           error (EXIT_FAILURE, 0,
+                 _("failed to compile regular expression '%s': %s"),
+                 rx, error_message);
+        }
       our_pred->est_success_rate = estimate_pattern_match_rate (rx, 1);
       return true;
     }
@@ -2081,7 +2083,7 @@ parse_size (const struct parser_table* entry, char 
**argv, int *arg_ptr)
 
   len = strlen (arg);
   if (len == 0)
-    die (EXIT_FAILURE, 0, _("invalid null argument to -size"));
+    error (EXIT_FAILURE, 0, _("invalid null argument to -size"));
 
   suffix = arg[len - 1];
   switch (suffix)
@@ -2130,8 +2132,8 @@ parse_size (const struct parser_table* entry, char 
**argv, int *arg_ptr)
       break;
 
     default:
-      die (EXIT_FAILURE, 0,
-          _("invalid -size type `%c'"), argv[*arg_ptr][len - 1]);
+      error (EXIT_FAILURE, 0,
+            _("invalid -size type `%c'"), argv[*arg_ptr][len - 1]);
     }
   /* TODO: accept fractional mebibytes etc. ? */
   if (!get_num (arg, &num, &c_type))
@@ -2140,9 +2142,9 @@ parse_size (const struct parser_table* entry, char 
**argv, int *arg_ptr)
       tail[0] = suffix;
       tail[1] = 0;
 
-      die (EXIT_FAILURE, 0,
-          _("Invalid argument `%s%s' to -size"),
-          arg, tail);
+      error (EXIT_FAILURE, 0,
+            _("Invalid argument `%s%s' to -size"),
+            arg, tail);
       return false;
     }
   our_pred = insert_primary (entry, arg);
@@ -2329,7 +2331,7 @@ parse_show_control_chars (const struct parser_table* 
entry,
 
   if ((argv == NULL) || (argv[*arg_ptr] == NULL))
     {
-      die (EXIT_FAILURE, errno, "%s", errmsg);
+      error (EXIT_FAILURE, errno, "%s", errmsg);
       return false;
     }
   else
@@ -2346,7 +2348,7 @@ parse_show_control_chars (const struct parser_table* 
entry,
        }
       else
        {
-         die (EXIT_FAILURE, errno, "%s", errmsg);
+         error (EXIT_FAILURE, errno, "%s", errmsg);
          return false;
        }
       (*arg_ptr)++;            /* consume the argument. */
@@ -2432,8 +2434,8 @@ parse_used (const struct parser_table* entry, char 
**argv, int *arg_ptr)
        }
       else
        {
-         die (EXIT_FAILURE, 0,
-              _("Invalid argument %s to -used"), offset_str);
+         error (EXIT_FAILURE, 0,
+                _("Invalid argument %s to -used"), offset_str);
          /*NOTREACHED*/
          return false;
        }
@@ -2473,15 +2475,15 @@ parse_user (const struct parser_table* entry, char 
**argv, int *arg_ptr)
               * not as helpful). */
              if (username[0])
                {
-                 die (EXIT_FAILURE, 0,
-                      _("%s is not the name of a known user"),
-                      quotearg_n_style (0, options.err_quoting_style,
-                                        username));
+                 error (EXIT_FAILURE, 0,
+                        _("%s is not the name of a known user"),
+                        quotearg_n_style (0, options.err_quoting_style,
+                                          username));
                }
              else
                {
-                 die (EXIT_FAILURE, 0,
-                      _("The argument to -user should not be empty"));
+                 error (EXIT_FAILURE, 0,
+                        _("The argument to -user should not be empty"));
                }
              /*NOTREACHED*/
              return false;
@@ -2566,8 +2568,8 @@ parse_context (const struct parser_table* entry, char 
**argv, int *arg_ptr)
 
   if (is_selinux_enabled () <= 0)
     {
-      die (EXIT_FAILURE, 0,
-          _("invalid predicate -context: SELinux is not enabled."));
+      error (EXIT_FAILURE, 0,
+            _("invalid predicate -context: SELinux is not enabled."));
       return false;
     }
   our_pred = insert_primary (entry, NULL);
@@ -2630,9 +2632,9 @@ insert_type (char **argv, int *arg_ptr,
 
   if (!*typeletter)
     {
-      die (EXIT_FAILURE, 0,
-          _("Arguments to %s should contain at least one letter"),
-          pred_string);
+      error (EXIT_FAILURE, 0,
+            _("Arguments to %s should contain at least one letter"),
+            pred_string);
       /*NOTREACHED*/
       return false;
     }
@@ -2695,10 +2697,10 @@ insert_type (char **argv, int *arg_ptr,
        rate = 0.0311f;
 #else
        type_cell = 0;
-       die (EXIT_FAILURE, 0,
-            _("%s %c is not supported because symbolic links "
-              "are not supported on the platform find was compiled on."),
-            pred_string, (*typeletter));
+       error (EXIT_FAILURE, 0,
+              _("%s %c is not supported because symbolic links "
+                "are not supported on the platform find was compiled on."),
+              pred_string, (*typeletter));
 #endif
        break;
       case 'p':                        /* pipe */
@@ -2707,10 +2709,10 @@ insert_type (char **argv, int *arg_ptr,
        rate = 7.554e-6f;
 #else
        type_cell = 0;
-       die (EXIT_FAILURE, 0,
-            _("%s %c is not supported because FIFOs "
-              "are not supported on the platform find was compiled on."),
-            pred_string, (*typeletter));
+       error (EXIT_FAILURE, 0,
+              _("%s %c is not supported because FIFOs "
+                "are not supported on the platform find was compiled on."),
+              pred_string, (*typeletter));
 #endif
        break;
       case 's':                        /* socket */
@@ -2719,10 +2721,10 @@ insert_type (char **argv, int *arg_ptr,
        rate = 1.59e-5f;
 #else
        type_cell = 0;
-       die (EXIT_FAILURE, 0,
-            _("%s %c is not supported because named sockets "
-              "are not supported on the platform find was compiled on."),
-            pred_string, (*typeletter));
+       error (EXIT_FAILURE, 0,
+              _("%s %c is not supported because named sockets "
+                "are not supported on the platform find was compiled on."),
+              pred_string, (*typeletter));
 #endif
        break;
       case 'D':                        /* Solaris door */
@@ -2735,25 +2737,25 @@ insert_type (char **argv, int *arg_ptr,
        rate = 1.0e-5f;
 #else
        type_cell = 0;
-       die (EXIT_FAILURE, 0,
-            _("%s %c is not supported because Solaris doors "
-              "are not supported on the platform find was compiled on."),
-            pred_string, (*typeletter));
+       error (EXIT_FAILURE, 0,
+              _("%s %c is not supported because Solaris doors "
+                "are not supported on the platform find was compiled on."),
+              pred_string, (*typeletter));
 #endif
        break;
       default:                 /* None of the above ... nuke 'em. */
        type_cell = 0;
-       die (EXIT_FAILURE, 0,
-            _("Unknown argument to %s: %c"), pred_string, (*typeletter));
+       error (EXIT_FAILURE, 0,
+              _("Unknown argument to %s: %c"), pred_string, (*typeletter));
        /*NOTREACHED*/
        return false;
       }
 
       if (our_pred->args.types[type_cell])
        {
-         die (EXIT_FAILURE, 0,
-              _("Duplicate file type '%c' in the argument list to %s."),
-              (*typeletter), pred_string);
+         error (EXIT_FAILURE, 0,
+                _("Duplicate file type '%c' in the argument list to %s."),
+                (*typeletter), pred_string);
        }
 
       our_pred->est_success_rate += rate;
@@ -2767,19 +2769,19 @@ insert_type (char **argv, int *arg_ptr,
        {
          if (*typeletter != ',')
            {
-             die (EXIT_FAILURE, 0,
-                  _("Must separate multiple arguments to %s using: ','"),
-                  pred_string);
+             error (EXIT_FAILURE, 0,
+                    _("Must separate multiple arguments to %s using: ','"),
+                    pred_string);
              /*NOTREACHED*/
              return false;
            }
          typeletter++;
          if (!*typeletter)
            {
-             die (EXIT_FAILURE, 0,
-                  _("Last file type in list argument to %s "
-                    "is missing, i.e., list is ending on: ','"),
-                  pred_string);
+             error (EXIT_FAILURE, 0,
+                    _("Last file type in list argument to %s "
+                      "is missing, i.e., list is ending on: ','"),
+                    pred_string);
              /*NOTREACHED*/
              return false;
            }
@@ -2835,25 +2837,25 @@ check_path_safety (const char *action)
       if (0 == len || (1 == len && path[pos] == '.'))
        {
          /* empty field signifies . */
-         die (EXIT_FAILURE, 0,
-              _("The current directory is included in the PATH "
-                "environment variable, which is insecure in "
-                "combination with the %s action of find.  "
-                "Please remove the current directory from your "
-                "$PATH (that is, remove \".\", doubled colons, "
-                "or leading or trailing colons)"),
-              action);
+         error (EXIT_FAILURE, 0,
+                _("The current directory is included in the PATH "
+                  "environment variable, which is insecure in "
+                  "combination with the %s action of find.  "
+                  "Please remove the current directory from your "
+                  "$PATH (that is, remove \".\", doubled colons, "
+                  "or leading or trailing colons)"),
+                action);
        }
       else if (path[pos] != '/')
        {
          char *relpath = strndup (&path[pos], len);
-         die (EXIT_FAILURE, 0,
-              _("The relative path %s is included in the PATH "
-                "environment variable, which is insecure in "
-                "combination with the %s action of find.  "
-                "Please remove that entry from $PATH"),
-              safely_quote_err_filename (0, relpath ? relpath : &path[pos]),
-              action);
+         error (EXIT_FAILURE, 0,
+                _("The relative path %s is included in the PATH "
+                  "environment variable, which is insecure in "
+                  "combination with the %s action of find.  "
+                  "Please remove that entry from $PATH"),
+                safely_quote_err_filename (0, relpath ? relpath : &path[pos]),
+                action);
          /*NOTREACHED*/
          free (relpath);
        }
@@ -2958,10 +2960,10 @@ insert_exec_ok (const char *action,
               * allowed.  We can specify this as those options are
               * not defined by POSIX.
               */
-             die (EXIT_FAILURE, 0,
-                  _("You may not use {} within the utility name for "
-                    "-execdir and -okdir, because this is a potential "
-                    "security problem."));
+             error (EXIT_FAILURE, 0,
+                    _("You may not use {} within the utility name for "
+                      "-execdir and -okdir, because this is a potential "
+                      "security problem."));
            }
        }
     }
@@ -2984,9 +2986,9 @@ insert_exec_ok (const char *action,
 
       if (brace_count > 1)
        {
-         die (EXIT_FAILURE, 0,
-              _("Only one instance of {} is supported with -exec%s ... +"),
-              suffix);
+         error (EXIT_FAILURE, 0,
+                _("Only one instance of {} is supported with -exec%s ... +"),
+                suffix);
        }
       else if (strlen (brace_arg) != 2u)
        {
@@ -2994,11 +2996,11 @@ insert_exec_ok (const char *action,
          char buf[MsgBufSize];
          const size_t needed = snprintf (buf, MsgBufSize, "-exec%s ... {} +", 
suffix);
          assert (needed <= MsgBufSize);  /* If this assertion fails, correct 
the value of MsgBufSize. */
-         die (EXIT_FAILURE, 0,
-              _("In %s the %s must appear by itself, but you specified %s"),
-              quotearg_n_style (0, options.err_quoting_style, buf),
-              quotearg_n_style (1, options.err_quoting_style, "{}"),
-              quotearg_n_style (2, options.err_quoting_style, brace_arg));
+         error (EXIT_FAILURE, 0,
+                _("In %s the %s must appear by itself, but you specified %s"),
+                quotearg_n_style (0, options.err_quoting_style, buf),
+                quotearg_n_style (1, options.err_quoting_style, "{}"),
+                quotearg_n_style (2, options.err_quoting_style, brace_arg));
        }
     }
 
@@ -3014,7 +3016,7 @@ insert_exec_ok (const char *action,
     {
     case BC_INIT_ENV_TOO_BIG:
     case BC_INIT_CANNOT_ACCOMODATE_HEADROOM:
-      die (EXIT_FAILURE, 0, _("The environment is too large for exec()."));
+      error (EXIT_FAILURE, 0, _("The environment is too large for exec()."));
       break;
     case BC_INIT_OK:
       /* Good news.  Carry on. */
@@ -3124,8 +3126,8 @@ get_relative_timestamp (const char *str,
        {
          if (isnan (offset))
            {
-             die (EXIT_FAILURE, 0, _("invalid not-a-number argument: `%s'"),
-                  str);
+             error (EXIT_FAILURE, 0, _("invalid not-a-number argument: `%s'"),
+                    str);
            }
 
          /* Separate the floating point number the user specified
@@ -3146,7 +3148,7 @@ get_relative_timestamp (const char *str,
          if ((origin.tv_sec < result->ts.tv_sec) != (seconds < 0))
            {
              /* an overflow has occurred. */
-             die (EXIT_FAILURE, 0, overflowmessage, str);
+             error (EXIT_FAILURE, 0, overflowmessage, str);
            }
 
          result->ts.tv_nsec = origin.tv_nsec - nanosec;
@@ -3212,8 +3214,8 @@ parse_time (const struct parser_table* entry, char 
*argv[], int *arg_ptr)
          origin.tv_sec += (DAYSECS-1);
          if (expected != (uintmax_t)origin.tv_sec)
            {
-             die (EXIT_FAILURE, 0,
-                  _("arithmetic overflow when trying to calculate the end of 
today"));
+             error (EXIT_FAILURE, 0,
+                    _("arithmetic overflow when trying to calculate the end of 
today"));
            }
        }
     }
@@ -3362,10 +3364,10 @@ insert_num (char **argv, int *arg_ptr, const struct 
parser_table *entry)
     else
       {
        const char *predicate = argv[(*arg_ptr)-2];
-       die (EXIT_FAILURE, 0,
-            _("non-numeric argument to %s: %s"),
-            predicate,
-            quotearg_n_style (0, options.err_quoting_style, numstr));
+       error (EXIT_FAILURE, 0,
+              _("non-numeric argument to %s: %s"),
+              predicate,
+              quotearg_n_style (0, options.err_quoting_style, numstr));
        /*NOTREACHED*/
        return NULL;
       }
diff --git a/find/pred.c b/find/pred.c
index b5a642b4..f50954f9 100644
--- a/find/pred.c
+++ b/find/pred.c
@@ -37,7 +37,6 @@
 /* gnulib headers. */
 #include "areadlink.h"
 #include "dirname.h"
-#include "error.h"
 #include "fcntl--.h"
 #include "fnmatch.h"
 #include "stat-size.h"
@@ -46,7 +45,6 @@
 
 /* find headers. */
 #include "defs.h"
-#include "die.h"
 #include "dircallback.h"
 #include "listfile.h"
 #include "printquoted.h"
@@ -697,7 +695,7 @@ is_ok (const char *program, const char *arg)
   /* XXX: printing UNTRUSTED data here. */
   if (fprintf (stderr, _("< %s ... %s > ? "), program, arg) < 0)
     {
-      die (EXIT_FAILURE, errno, _("Failed to write prompt for -ok"));
+      error (EXIT_FAILURE, errno, _("Failed to write prompt for -ok"));
     }
   fflush (stderr);
   return yesno ();
diff --git a/find/print.c b/find/print.c
index b04bfef8..5a027e0b 100644
--- a/find/print.c
+++ b/find/print.c
@@ -32,7 +32,6 @@
 /* gnulib headers. */
 #include "areadlink.h"
 #include "dirname.h"
-#include "error.h"
 #include "filemode.h"
 #include "human.h"
 #include "printquoted.h"
@@ -44,7 +43,6 @@
 /* find-specific headers. */
 #include "system.h"
 #include "defs.h"
-#include "die.h"
 #include "print.h"
 
 
@@ -370,8 +368,8 @@ insert_fprintf (struct format_val *vec,
           if (fmt_editpos[1] == 0)
             {
               /* Trailing %.  We don't like those. */
-              die (EXIT_FAILURE, 0,
-                   _("error: %s at end of format string"), fmt_editpos);
+              error (EXIT_FAILURE, 0,
+                     _("error: %s at end of format string"), fmt_editpos);
             }
 
           if (fmt_editpos[1] == '%') /* %% produces just %. */
@@ -394,9 +392,9 @@ insert_fprintf (struct format_val *vec,
             {
               if (strchr ("{[(", fmt_editpos[0]))
                 {
-                  die (EXIT_FAILURE, 0,
-                       _("error: the format directive `%%%c' is reserved for 
future use"),
-                       (int)fmt_editpos[0]);
+                  error (EXIT_FAILURE, 0,
+                         _("error: the format directive `%%%c' is reserved for 
future use"),
+                         (int)fmt_editpos[0]);
                   /*NOTREACHED*/
                 }
 
@@ -1257,7 +1255,7 @@ do_fprintf (struct format_val *dest,
             simply to ensure that the error message matches the one
             in insert_fprintf, easing the translation burden.
           */
-         die (EXIT_FAILURE, 0, _("error: %s at end of format string"), "%");
+         error (EXIT_FAILURE, 0, _("error: %s at end of format string"), "%");
          /*NOTREACHED*/
          break;
         }
diff --git a/find/tree.c b/find/tree.c
index e6166fc3..9fb501c9 100644
--- a/find/tree.c
+++ b/find/tree.c
@@ -23,13 +23,11 @@
 #include <stdlib.h>
 
 /* gnulib headers. */
-#include "error.h"
 #include "fnmatch.h"
 #include "xalloc.h"
 
 /* find headers. */
 #include "defs.h"
-#include "die.h"
 #include "system.h"
 
 
@@ -112,28 +110,28 @@ get_expr (struct predicate **input,
   struct predicate *this_pred = (*input);
 
   if (*input == NULL)
-    die (EXIT_FAILURE, 0, _("invalid expression"));
+    error (EXIT_FAILURE, 0, _("invalid expression"));
 
   switch ((*input)->p_type)
     {
     case NO_TYPE:
-      die (EXIT_FAILURE, 0, _("invalid expression"));
+      error (EXIT_FAILURE, 0, _("invalid expression"));
       break;
 
     case BI_OP:
       /* e.g. "find . -a" */
-      die (EXIT_FAILURE, 0,
-          _("invalid expression; you have used a binary operator '%s' with 
nothing before it."),
-          this_pred->p_name);
+      error (EXIT_FAILURE, 0,
+            _("invalid expression; you have used a binary operator '%s' with 
nothing before it."),
+            this_pred->p_name);
       break;
 
     case CLOSE_PAREN:
       if (prev_pred == NULL)
        {
          /* Happens with e.g. "find -files0-from - ')' -print" */
-         die (EXIT_FAILURE, 0,
-              _("invalid expression: expected expression before closing 
parentheses '%s'."),
-              this_pred->p_name);
+         error (EXIT_FAILURE, 0,
+                _("invalid expression: expected expression before closing 
parentheses '%s'."),
+                this_pred->p_name);
        }
 
       if ((UNI_OP == prev_pred->p_type
@@ -141,9 +139,9 @@ get_expr (struct predicate **input,
          && !this_pred->artificial)
        {
          /* e.g. "find \( -not \)" or "find \( -true -a \)" */
-         die (EXIT_FAILURE, 0,
-              _("expected an expression between '%s' and ')'"),
-              prev_pred->p_name);
+         error (EXIT_FAILURE, 0,
+                _("expected an expression between '%s' and ')'"),
+                prev_pred->p_name);
        }
       else if ( (*input)->artificial )
        {
@@ -151,13 +149,13 @@ get_expr (struct predicate **input,
           * unexpectedly.
           */
          /* e.g. "find . -true -a" */
-         die (EXIT_FAILURE, 0,
-              _("expected an expression after '%s'"), prev_pred->p_name);
+         error (EXIT_FAILURE, 0,
+                _("expected an expression after '%s'"), prev_pred->p_name);
        }
       else
        {
-         die (EXIT_FAILURE, 0,
-              _("invalid expression; you have too many ')'"));
+         error (EXIT_FAILURE, 0,
+                _("invalid expression; you have too many ')'"));
        }
       break;
 
@@ -179,10 +177,10 @@ get_expr (struct predicate **input,
           * looking at is from the artificial "( ) -print" that we
           * add.
           */
-         die (EXIT_FAILURE, 0,
-              _("invalid expression; expected to find a ')' but didn't see 
one. "
-                "Perhaps you need an extra predicate after '%s'"),
-              this_pred->p_name);
+         error (EXIT_FAILURE, 0,
+                _("invalid expression; expected to find a ')' but didn't see 
one. "
+                  "Perhaps you need an extra predicate after '%s'"),
+                this_pred->p_name);
        }
       prev_pred = (*input);
       *input = (*input)->pred_next;
@@ -190,25 +188,25 @@ get_expr (struct predicate **input,
        {
          if (prev_pred->artificial)
            {
-             die (EXIT_FAILURE, 0,
-                  _("invalid expression: expected expression before closing 
parentheses '%s'."),
-                  (*input)->p_name);
+             error (EXIT_FAILURE, 0,
+                    _("invalid expression: expected expression before closing 
parentheses '%s'."),
+                    (*input)->p_name);
            }
-         die (EXIT_FAILURE, 0,
-              _("invalid expression; empty parentheses are not allowed."));
+         error (EXIT_FAILURE, 0,
+                _("invalid expression; empty parentheses are not allowed."));
        }
       next = get_expr (input, NO_PREC, prev_pred);
       if ((*input == NULL)
          || ((*input)->p_type != CLOSE_PAREN))
-       die (EXIT_FAILURE, 0,
-            _("invalid expression; I was expecting to find a ')' somewhere "
-              "but did not see one."));
+       error (EXIT_FAILURE, 0,
+              _("invalid expression; I was expecting to find a ')' somewhere "
+                "but did not see one."));
 
       *input = (*input)->pred_next;    /* move over close */
       break;
 
     default:
-      die (EXIT_FAILURE, 0, _("oops -- invalid expression type!"));
+      error (EXIT_FAILURE, 0, _("oops -- invalid expression type!"));
       break;
     }
 
@@ -223,7 +221,7 @@ get_expr (struct predicate **input,
     {
       next = scan_rest (input, next, prev_prec);
       if (next == NULL)
-       die (EXIT_FAILURE, 0, _("invalid expression"));
+       error (EXIT_FAILURE, 0, _("invalid expression"));
     }
   return (next);
 }
@@ -262,7 +260,7 @@ scan_rest (struct predicate **input,
          /* I'm not sure how we get here, so it is not obvious what
           * sort of mistakes might give rise to this condition.
           */
-         die (EXIT_FAILURE, 0, _("invalid expression"));
+         error (EXIT_FAILURE, 0, _("invalid expression"));
          break;
 
        case BI_OP:
@@ -279,9 +277,9 @@ scan_rest (struct predicate **input,
          return tree;
 
        default:
-         die (EXIT_FAILURE, 0,
-              _("oops -- invalid expression type (%d)!"),
-              (int)(*input)->p_type);
+         error (EXIT_FAILURE, 0,
+                _("oops -- invalid expression type (%d)!"),
+                (int)(*input)->p_type);
          break;
        }
     }
@@ -832,7 +830,7 @@ opt_expr (struct predicate **eval_treep)
             all of the user's parentheses. */
 
        default:
-         die (EXIT_FAILURE, 0, _("oops -- invalid expression type!"));
+         error (EXIT_FAILURE, 0, _("oops -- invalid expression type!"));
          break;
        }
 
@@ -1087,7 +1085,7 @@ get_pred_cost (const struct predicate *p)
                             sizeof(costlookup[0]),
                             cost_table_comparison))
            {
-             die (EXIT_FAILURE, 0, "failed to sort the costlookup array");
+             error (EXIT_FAILURE, 0, _("failed to sort the costlookup array"));
            }
          pred_table_sorted = 1;
        }
@@ -1295,7 +1293,7 @@ build_expression_tree (int argc, char *argv[], int 
end_of_leading_options)
       if (parse_entry == NULL)
        {
          /* Command line option not recognized */
-         die (EXIT_FAILURE, 0, _("unknown predicate `%s'"), predicate_name);
+         error (EXIT_FAILURE, 0, _("unknown predicate `%s'"), predicate_name);
        }
 
       /* We have recognised a test of the form -foo.  Eat that,
@@ -1315,18 +1313,18 @@ build_expression_tree (int argc, char *argv[], int 
end_of_leading_options)
                  /* The special parse function spat out the
                   * predicate.  It must be invalid, or not tasty.
                   */
-                 die (EXIT_FAILURE, 0, _("invalid predicate `%s'"), 
predicate_name);
+                 error (EXIT_FAILURE, 0, _("invalid predicate `%s'"), 
predicate_name);
                }
              else
                {
-                 die (EXIT_FAILURE, 0, _("invalid argument `%s' to `%s'"),
-                      argv[i], predicate_name);
+                 error (EXIT_FAILURE, 0, _("invalid argument `%s' to `%s'"),
+                        argv[i], predicate_name);
                }
            }
          else
            {
              /* Command line option requires an argument */
-             die (EXIT_FAILURE, 0, _("missing argument to `%s'"), 
predicate_name);
+             error (EXIT_FAILURE, 0, _("missing argument to `%s'"), 
predicate_name);
            }
        }
       else
@@ -1402,15 +1400,15 @@ build_expression_tree (int argc, char *argv[], int 
end_of_leading_options)
       if (pred_is (cur_pred, pred_closeparen))
        {
          /* e.g. "find \( -true \) \)" */
-         die (EXIT_FAILURE, 0, _("you have too many ')'"));
+         error (EXIT_FAILURE, 0, _("you have too many ')'"));
        }
       else
        {
          if (cur_pred->p_name)
-           die (EXIT_FAILURE, 0,
-                _("unexpected extra predicate '%s'"), cur_pred->p_name);
+           error (EXIT_FAILURE, 0,
+                  _("unexpected extra predicate '%s'"), cur_pred->p_name);
          else
-           die (EXIT_FAILURE, 0, _("unexpected extra predicate"));
+           error (EXIT_FAILURE, 0, _("unexpected extra predicate"));
        }
     }
 
@@ -1531,7 +1529,7 @@ get_new_pred_chk_op (const struct parser_table *entry,
     switch (last_pred->p_type)
       {
       case NO_TYPE:
-       die (EXIT_FAILURE, 0, _("oops -- invalid default insertion of and!"));
+       error (EXIT_FAILURE, 0, _("oops -- invalid default insertion of and!"));
        break;
 
       case PRIMARY_TYPE:
diff --git a/find/util.c b/find/util.c
index e2a2c244..094b2b58 100644
--- a/find/util.c
+++ b/find/util.c
@@ -30,7 +30,6 @@
 #include <sys/utsname.h>
 
 /* gnulib headers. */
-#include "error.h"
 #include "fdleak.h"
 #include "progname.h"
 #include "quotearg.h"
@@ -40,7 +39,6 @@
 
 /* find headers. */
 #include "defs.h"
-#include "die.h"
 #include "dircallback.h"
 #include "bugreports.h"
 #include "system.h"
@@ -471,10 +469,10 @@ record_initial_cwd (void)
   initial_wd = xmalloc (sizeof (*initial_wd));
   if (0 != save_cwd (initial_wd))
     {
-      die (EXIT_FAILURE, errno,
-          _("Failed to save initial working directory%s%s"),
-          (initial_wd->desc < 0 && initial_wd->name) ? ": " : "",
-          (initial_wd->desc < 0 && initial_wd->name) ? initial_wd->name : "");
+      error (EXIT_FAILURE, errno,
+            _("Failed to save initial working directory%s%s"),
+            (initial_wd->desc < 0 && initial_wd->name) ? ": " : "",
+            (initial_wd->desc < 0 && initial_wd->name) ? initial_wd->name : 
"");
     }
 }
 
@@ -852,8 +850,8 @@ process_optimisation_option (const char *arg)
 {
   if (0 == arg[0])
     {
-      die (EXIT_FAILURE, 0,
-          _("The -O option must be immediately followed by a decimal 
integer"));
+      error (EXIT_FAILURE, 0,
+            _("The -O option must be immediately followed by a decimal 
integer"));
     }
   else
     {
@@ -862,8 +860,8 @@ process_optimisation_option (const char *arg)
 
       if (!isdigit ( (unsigned char) arg[0] ))
        {
-         die (EXIT_FAILURE, 0,
-              _("Please specify a decimal number immediately after -O"));
+         error (EXIT_FAILURE, 0,
+                _("Please specify a decimal number immediately after -O"));
        }
       else
        {
@@ -873,29 +871,29 @@ process_optimisation_option (const char *arg)
          opt_level = strtoul (arg, &end, 10);
          if ( (0==opt_level) && (end==arg) )
            {
-             die (EXIT_FAILURE, 0,
-                  _("Please specify a decimal number immediately after -O"));
+             error (EXIT_FAILURE, 0,
+                    _("Please specify a decimal number immediately after -O"));
            }
          else if (*end)
            {
              /* unwanted trailing characters. */
-             die (EXIT_FAILURE, 0, _("Invalid optimisation level %s"), arg);
+             error (EXIT_FAILURE, 0, _("Invalid optimisation level %s"), arg);
            }
          else if ( (ULONG_MAX==opt_level) && errno)
            {
-             die (EXIT_FAILURE, errno,
-                  _("Invalid optimisation level %s"), arg);
+             error (EXIT_FAILURE, errno,
+                    _("Invalid optimisation level %s"), arg);
            }
          else if (opt_level > USHRT_MAX)
            {
              /* tricky to test, as on some platforms USHORT_MAX and ULONG_MAX
               * can have the same value, though this is unusual.
               */
-             die (EXIT_FAILURE, 0,
-                  _("Optimisation level %lu is too high.  "
-                    "If you want to find files very quickly, "
-                    "consider using GNU locate."),
-                  opt_level);
+             error (EXIT_FAILURE, 0,
+                    _("Optimisation level %lu is too high.  "
+                      "If you want to find files very quickly, "
+                      "consider using GNU locate."),
+                    opt_level);
            }
          else
            {
@@ -1040,10 +1038,10 @@ set_option_defaults (struct options *p)
 
   if (getenv ("FIND_BLOCK_SIZE"))
     {
-      die (EXIT_FAILURE, 0,
-          _("The environment variable FIND_BLOCK_SIZE is not supported, "
-            "the only thing that affects the block size is the "
-            "POSIXLY_CORRECT environment variable"));
+      error (EXIT_FAILURE, 0,
+            _("The environment variable FIND_BLOCK_SIZE is not supported, "
+              "the only thing that affects the block size is the "
+              "POSIXLY_CORRECT environment variable"));
     }
 
 #if LEAF_OPTIMISATION
diff --git a/lib/Makefile.am b/lib/Makefile.am
index eb61ccf4..8a4f7e2b 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -58,8 +58,7 @@ libfind_a_SOURCES = \
        splitstring.h \
        bugreports.c \
        bugreports.h \
-       system.h \
-       die.h
+       system.h
 
 EXTRA_DIST = unused-result.h check-regexprops.sh
 SUFFIXES =
diff --git a/lib/buildcmd.c b/lib/buildcmd.c
index 9412b230..a5ed4dcb 100644
--- a/lib/buildcmd.c
+++ b/lib/buildcmd.c
@@ -37,7 +37,6 @@
 /* find headers. */
 #include "system.h"
 #include "buildcmd.h"
-#include "die.h"
 
 
 /* COMPAT:  SYSV version defaults size (and has a max value of) to 470.
@@ -141,7 +140,7 @@ bc_do_insert (struct buildcmd_control *ctl,
     }
   while (*arg);
   if (*arg)
-    die (EXIT_FAILURE, 0, _("command too long"));
+    error (EXIT_FAILURE, 0, _("command too long"));
   *p++ = '\0';
 
   bc_push_arg (ctl, state,
@@ -280,8 +279,8 @@ bc_do_exec (struct buildcmd_control *ctl,
              {
                /* No room to reduce the length of the argument list.
                   Issue an error message and give up. */
-               die (EXIT_FAILURE, 0,
-                    _("can't call exec() due to argument size restrictions"));
+               error (EXIT_FAILURE, 0,
+                      _("can't call exec() due to argument size 
restrictions"));
              }
            else
              {
@@ -345,14 +344,18 @@ bc_push_arg (struct buildcmd_control *ctl,
       if (state->cmd_argv_chars + len + pfxlen > ctl->arg_max)
         {
           if (initial_args || state->cmd_argc == ctl->initial_argc)
-            die (EXIT_FAILURE, 0,
-                _("cannot fit single argument within argument list size 
limit"));
+            {
+              error (EXIT_FAILURE, 0,
+                     _("cannot fit single argument within argument list size 
limit"));
+            }
 
           /* xargs option -i (replace_pat) implies -x (exit_if_size_exceeded) 
*/
           if (ctl->replace_pat
               || (ctl->exit_if_size_exceeded &&
                   (ctl->lines_per_exec || ctl->args_per_exec)))
-            die (EXIT_FAILURE, 0, _("argument list too long"));
+            {
+              error (EXIT_FAILURE, 0, _("argument list too long"));
+            }
           bc_do_exec (ctl, state);
         }
       if (bc_argc_limit_reached (initial_args, ctl, state))
@@ -608,10 +611,10 @@ exceeds (const char *env_var_name, size_t quantity)
        }
       else
        {
-         die (EXIT_FAILURE, errno,
-              _("Environment variable %s is not set to a "
-                "valid decimal number"),
-              env_var_name);
+         error (EXIT_FAILURE, errno,
+                _("Environment variable %s is not set to a "
+                  "valid decimal number"),
+                env_var_name);
          return 0;
        }
     }
diff --git a/lib/die.h b/lib/die.h
deleted file mode 100644
index 2109de1c..00000000
--- a/lib/die.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Report an error and exit.
-   Copyright (C) 2017-2023 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
-   the Free Software Foundation, either version 3, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
-   02110-1301, USA.  */
-
-/* Borrowed from coreutils.  */
-#ifndef DIE_H
-# define DIE_H
-
-# include <error.h>
-# include <stdbool.h>
-# include <verify.h>
-
-/* Like 'error (STATUS, ...)', except STATUS must be a nonzero constant.
-   This may pacify the compiler or help it generate better code.  */
-# define die(status, ...) \
-  verify_expr (status, (error (status, __VA_ARGS__), assume (false)))
-
-#endif /* DIE_H */
diff --git a/lib/fdleak.c b/lib/fdleak.c
index 87ece559..84f6d4d9 100644
--- a/lib/fdleak.c
+++ b/lib/fdleak.c
@@ -35,7 +35,6 @@
 /* gnulib headers. */
 #include "cloexec.h"
 #include "dirent--.h"
-#include "error.h"
 #include "fcntl--.h"
 
 /* find headers. */
diff --git a/lib/listfile.c b/lib/listfile.c
index 3f0397b5..c1803a5b 100644
--- a/lib/listfile.c
+++ b/lib/listfile.c
@@ -33,7 +33,6 @@
 
 /* gnulib headers. */
 #include "areadlink.h"
-#include "error.h"
 #include "filemode.h"
 #include "human.h"
 #include "mbswidth.h"
@@ -43,7 +42,6 @@
 
 /* find headers. */
 #include "system.h"
-#include "die.h"
 #include "listfile.h"
 
 /* Since major is a function on SVR4, we can't use `ifndef major'.  */
@@ -451,7 +449,7 @@ list_file (const char *name,
     }
   if (!output_good)
     {
-      die (EXIT_FAILURE, errno, _("Failed to write output (at stage %d)"), 
failed_at);
+      error (EXIT_FAILURE, errno, _("Failed to write output (at stage %d)"), 
failed_at);
     }
 }
 
diff --git a/lib/regextype.c b/lib/regextype.c
index 9c3c7788..ffd09002 100644
--- a/lib/regextype.c
+++ b/lib/regextype.c
@@ -35,7 +35,6 @@
 
 /* findutils headers */
 #include "system.h"
-#include "die.h"
 
 
 struct tagRegexTypeMap
@@ -94,10 +93,10 @@ get_regex_type (const char *s)
       p += sprintf (p, "%s", quote (regex_map[i].name));
     }
 
-  die (EXIT_FAILURE, 0,
-       _("Unknown regular expression type %s; valid types are %s."),
-       quote (s),
-       buf);
+  error (EXIT_FAILURE, 0,
+         _("Unknown regular expression type %s; valid types are %s."),
+         quote (s),
+         buf);
   /*NOTREACHED*/
   return -1;
 }
diff --git a/lib/safe-atoi.c b/lib/safe-atoi.c
index 42774920..3b85dcd9 100644
--- a/lib/safe-atoi.c
+++ b/lib/safe-atoi.c
@@ -27,7 +27,6 @@
 
 /* find headers. */
 #include "system.h"
-#include "die.h"
 #include "safe-atoi.h"
 
 
@@ -45,12 +44,12 @@ safe_atoi (const char *s, enum quoting_style style)
       if (errno == ERANGE)
        {
          /* too big, or too small. */
-         die (EXIT_FAILURE, errno, "%s", s);
+         error (EXIT_FAILURE, errno, "%s", s);
        }
       else
        {
          /* not a valid number */
-         die (EXIT_FAILURE, errno, "%s", s);
+         error (EXIT_FAILURE, errno, "%s", s);
        }
       /* Otherwise, we do a range check against INT_MAX and INT_MIN
        * below.
@@ -61,18 +60,18 @@ safe_atoi (const char *s, enum quoting_style style)
     {
       /* The number was in range for long, but not int. */
       errno = ERANGE;
-      die (EXIT_FAILURE, errno, "%s", s);
+      error (EXIT_FAILURE, errno, "%s", s);
     }
   else if (*end)
     {
-      die (EXIT_FAILURE, errno, _("Unexpected suffix %s on %s"),
-          quotearg_n_style (0, style, end),
-          quotearg_n_style (1, style, s));
+      error (EXIT_FAILURE, errno, _("Unexpected suffix %s on %s"),
+             quotearg_n_style (0, style, end),
+             quotearg_n_style (1, style, s));
     }
   else if (end == s)
     {
-      die (EXIT_FAILURE, errno, _("Expected an integer: %s"),
-          quotearg_n_style (0, style, s));
+      error (EXIT_FAILURE, errno, _("Expected an integer: %s"),
+             quotearg_n_style (0, style, s));
     }
   return (int)lval;
 }
diff --git a/lib/system.h b/lib/system.h
index 9457a412..3d8b9489 100644
--- a/lib/system.h
+++ b/lib/system.h
@@ -20,6 +20,8 @@
 
 # include <locale.h>
 
+# include "error.h"
+
 /* Take care of NLS matters.  */
 
 # include "gettext.h"
diff --git a/locate/frcode.c b/locate/frcode.c
index a284e6c9..24c9ed07 100644
--- a/locate/frcode.c
+++ b/locate/frcode.c
@@ -78,14 +78,12 @@
 
 /* gnulib headers. */
 #include "closeout.h"
-#include "error.h"
 #include "progname.h"
 #include "xalloc.h"
 
 /* find headers. */
 #include "system.h"
 #include "bugreports.h"
-#include "die.h"
 #include "findutils-version.h"
 #include "gcc-function-attributes.h"
 #include "locatedb.h"
@@ -165,24 +163,24 @@ get_seclevel (char *s)
   result = strtol (s, &p, 10);
   if ((0==result) && (p == optarg))
     {
-      die (EXIT_FAILURE, 0,
-          _("You need to specify a security level as a decimal integer."));
+      error (EXIT_FAILURE, 0,
+            _("You need to specify a security level as a decimal integer."));
       /*NOTREACHED*/
       return -1;
     }
   else if ((LONG_MIN==result || LONG_MAX==result) && errno)
 
     {
-      die (EXIT_FAILURE, 0,
-          _("Security level %s is outside the convertible range."), s);
+      error (EXIT_FAILURE, 0,
+            _("Security level %s is outside the convertible range."), s);
       /*NOTREACHED*/
       return -1;
     }
   else if (*p)
     {
       /* Some suffix exists */
-      die (EXIT_FAILURE, 0,
-          _("Security level %s has unexpected suffix %s."), s, p);
+      error (EXIT_FAILURE, 0,
+            _("Security level %s has unexpected suffix %s."), s, p);
       /*NOTREACHED*/
       return -1;
     }
@@ -196,7 +194,7 @@ static void
 outerr (void)
 {
   /* Issue the same error message as closeout () would. */
-  die (EXIT_FAILURE, errno, _("write error"));
+  error (EXIT_FAILURE, errno, _("write error"));
 }
 
 int
@@ -219,7 +217,7 @@ main (int argc, char **argv)
 
   if (atexit (close_stdout))
     {
-      die (EXIT_FAILURE, errno, _("The atexit library function failed"));
+      error (EXIT_FAILURE, errno, _("The atexit library function failed"));
     }
 
   pathsize = oldpathsize = 1026; /* Increased as necessary by getline.  */
@@ -242,9 +240,9 @@ main (int argc, char **argv)
        slocate_seclevel = get_seclevel (optarg);
        if (slocate_seclevel < 0 || slocate_seclevel > 1)
          {
-           die (EXIT_FAILURE, 0,
-                _("slocate security level %ld is unsupported."),
-                slocate_seclevel);
+           error (EXIT_FAILURE, 0,
+                  _("slocate security level %ld is unsupported."),
+                  slocate_seclevel);
          }
        break;
 
@@ -279,7 +277,7 @@ main (int argc, char **argv)
       if (fwrite (LOCATEDB_MAGIC, 1, sizeof (LOCATEDB_MAGIC), stdout)
          != sizeof (LOCATEDB_MAGIC))
        {
-         die (EXIT_FAILURE, errno, _("Failed to write to standard output"));
+         error (EXIT_FAILURE, errno, _("Failed to write to standard output"));
        }
     }
 
diff --git a/locate/locate.c b/locate/locate.c
index a7f5eb75..b86e365a 100644
--- a/locate/locate.c
+++ b/locate/locate.c
@@ -83,7 +83,6 @@
 #include "fnmatch.h"
 #include "progname.h"
 #include "xalloc.h"
-#include "error.h"
 #include "fcntl--.h"
 #include "human.h"
 #include "dirname.h"
@@ -96,7 +95,6 @@
 /* find headers. */
 #include "system.h"
 #include "bugreports.h"
-#include "die.h"
 #include "findutils-version.h"
 #include "gcc-function-attributes.h"
 #include "locatedb.h"
@@ -156,8 +154,8 @@ set_max_db_age (const char *s)
 
   if (0 == *s)
     {
-      die (EXIT_FAILURE, 0,
-           _("The argument for option --max-database-age must not be empty"));
+      error (EXIT_FAILURE, 0,
+             _("The argument for option --max-database-age must not be 
empty"));
     }
 
 
@@ -172,16 +170,16 @@ set_max_db_age (const char *s)
   if ((ULONG_MAX == val && ERANGE == errno) ||
       (0 == val && EINVAL == errno))
     {
-      die (EXIT_FAILURE, errno,
-           _("Invalid argument %s for option --max-database-age"),
-           quotearg_n_style (0, locale_quoting_style, s));
+      error (EXIT_FAILURE, errno,
+             _("Invalid argument %s for option --max-database-age"),
+             quotearg_n_style (0, locale_quoting_style, s));
     }
   else if (*end)
     {
       /* errno wasn't set, don't print its message */
-      die (EXIT_FAILURE, 0,
-           _("Invalid argument %s for option --max-database-age"),
-           quotearg_n_style (0, locale_quoting_style, s));
+      error (EXIT_FAILURE, 0,
+             _("Invalid argument %s for option --max-database-age"),
+             quotearg_n_style (0, locale_quoting_style, s));
     }
   else
     {
@@ -429,10 +427,10 @@ visit_justprint_unquoted (struct process_data *procdata, 
void *context)
 static void
 toolong (struct process_data *procdata)
 {
-  die (EXIT_FAILURE, 0,
-       _("locate database %s contains a "
-         "filename longer than locate can handle"),
-       procdata->dbfile);
+  error (EXIT_FAILURE, 0,
+         _("locate database %s contains a "
+           "filename longer than locate can handle"),
+         procdata->dbfile);
 }
 
 static void
@@ -541,8 +539,8 @@ visit_locate02_format (struct process_data *procdata, void 
*context)
        * reading in data which is outside our control, we
        * cannot prevent it.
        */
-      die (EXIT_FAILURE, 0, _("locate database %s is corrupt or invalid"),
-           quotearg_n_style (0, locale_quoting_style, procdata->dbfile));
+      error (EXIT_FAILURE, 0, _("locate database %s is corrupt or invalid"),
+             quotearg_n_style (0, locale_quoting_style, procdata->dbfile));
     }
 
   /* Overlay the old path with the remainder of the new.  */
@@ -1142,10 +1140,10 @@ search_one_database (int argc,
                                      256 - nread, procdata.fp);
               if ( (more_read + nread) != 256 )
                 {
-                  die (EXIT_FAILURE, 0,
-                       _("Old-format locate database %s is "
-                         "too short to be valid"),
-                       quotearg_n_style (0, locale_quoting_style, dbfile));
+                  error (EXIT_FAILURE, 0,
+                         _("Old-format locate database %s is "
+                           "too short to be valid"),
+                         quotearg_n_style (0, locale_quoting_style, dbfile));
 
                 }
             }
@@ -1187,7 +1185,7 @@ search_one_database (int argc,
                                               &p->regex);
           if (error_message)
             {
-              die (EXIT_FAILURE, 0, "%s", error_message);
+              error (EXIT_FAILURE, 0, "%s", error_message);
             }
           else
             {
@@ -1490,8 +1488,8 @@ drop_privs (void)
   return 0;
 
  fail:
-  die (EXIT_FAILURE, errno, "%s",
-       quotearg_n_style (0, locale_quoting_style, what));
+  error (EXIT_FAILURE, errno, "%s",
+         quotearg_n_style (0, locale_quoting_style, what));
   abort ();
   kill (0, SIGKILL);
   _exit (1);
@@ -1565,7 +1563,7 @@ dolocate (int argc, char **argv, int secure_db_fd)
   quote_opts = clone_quoting_options (NULL);
   if (atexit (close_stdout) || atexit (cleanup_quote_opts))
     {
-      die (EXIT_FAILURE, errno, _("The atexit library function failed"));
+      error (EXIT_FAILURE, errno, _("The atexit library function failed"));
     }
 
   limits.limit = 0;
diff --git a/locate/word_io.c b/locate/word_io.c
index 1d643165..a1d29415 100644
--- a/locate/word_io.c
+++ b/locate/word_io.c
@@ -27,12 +27,10 @@
 
 /* gnulib headers. */
 #include "byteswap.h"
-#include "error.h"
 #include "quotearg.h"
 
 /* find headers. */
 #include "system.h"
-#include "die.h"
 #include "locatedb.h"
 
 
@@ -120,10 +118,10 @@ getword (FILE *fp,
        * Either condition is fatal.
        */
       if (feof (fp))
-       die (EXIT_FAILURE, 0, _("unexpected EOF in %s"), quoted_name);
+       error (EXIT_FAILURE, 0, _("unexpected EOF in %s"), quoted_name);
       else
-       die (EXIT_FAILURE, errno,
-            _("error reading a word from %s"), quoted_name);
+       error (EXIT_FAILURE, errno,
+              _("error reading a word from %s"), quoted_name);
       abort ();
     }
   else
diff --git a/xargs/xargs.c b/xargs/xargs.c
index 96e8897f..4020cd1e 100644
--- a/xargs/xargs.c
+++ b/xargs/xargs.c
@@ -53,7 +53,6 @@
 
 /* gnulib headers. */
 #include "closein.h"
-#include "error.h"
 #include "fcntl--.h"
 #include "progname.h"
 #include "quotearg.h"
@@ -63,7 +62,6 @@
 
 /* find headers. */
 #include "buildcmd.h"
-#include "die.h"
 #include "bugreports.h"
 #include "fdleak.h"
 #include "findutils-version.h"
@@ -253,9 +251,9 @@ get_char_oct_or_hex_escape (const char *s)
   else
     {
       p = NULL;                        /* Silence compiler warning. */
-      die (EXIT_FAILURE, 0,
-          _("Invalid escape sequence %s in input delimiter specification."),
-          s);
+      error (EXIT_FAILURE, 0,
+             _("Invalid escape sequence %s in input delimiter specification."),
+             s);
     }
   errno = 0;
   endp = NULL;
@@ -271,27 +269,27 @@ get_char_oct_or_hex_escape (const char *s)
     {
       if (16 == base)
        {
-         die (EXIT_FAILURE, 0,
-              _("Invalid escape sequence %s in input delimiter specification; "
-                "character values must not exceed %lx."),
-              s, (unsigned long)UCHAR_MAX);
+         error (EXIT_FAILURE, 0,
+                _("Invalid escape sequence %s in input delimiter 
specification; "
+                  "character values must not exceed %lx."),
+                s, (unsigned long)UCHAR_MAX);
        }
       else
        {
-         die (EXIT_FAILURE, 0,
-              _("Invalid escape sequence %s in input delimiter specification; "
-                "character values must not exceed %lo."),
-              s, (unsigned long)UCHAR_MAX);
+         error (EXIT_FAILURE, 0,
+                _("Invalid escape sequence %s in input delimiter 
specification; "
+                  "character values must not exceed %lo."),
+                s, (unsigned long)UCHAR_MAX);
        }
     }
 
   /* check for trailing garbage */
   if (0 != *endp)
     {
-      die (EXIT_FAILURE, 0,
-          _("Invalid escape sequence %s in input delimiter specification; "
-            "trailing characters %s not recognised."),
-          s, endp);
+      error (EXIT_FAILURE, 0,
+             _("Invalid escape sequence %s in input delimiter specification; "
+               "trailing characters %s not recognised."),
+             s, endp);
     }
 
   return (char) val;
@@ -334,11 +332,11 @@ get_input_delimiter (const char *s)
        }
       else
        {
-         die (EXIT_FAILURE, 0,
-              _("Invalid input delimiter specification %s: the delimiter must "
-                "be either a single character or an escape sequence starting "
-                "with \\."),
-              s);
+         error (EXIT_FAILURE, 0,
+                _("Invalid input delimiter specification %s: the delimiter 
must "
+                  "be either a single character or an escape sequence starting 
"
+                  "with \\."),
+                s);
          /*NOTREACHED*/
          return 0;
        }
@@ -354,7 +352,7 @@ noop (void)
 static void
 fail_due_to_env_size (void)
 {
-  die (EXIT_FAILURE, 0, _("environment is too large for exec"));
+  error (EXIT_FAILURE, 0, _("environment is too large for exec"));
 }
 
 static size_t
@@ -434,7 +432,7 @@ main (int argc, char **argv)
 
   if (atexit (close_stdin) || atexit (wait_for_proc_all))
     {
-      die (EXIT_FAILURE, errno, _("The atexit library function failed"));
+      error (EXIT_FAILURE, errno, _("The atexit library function failed"));
     }
 
   /* xargs is required by POSIX to allow 2048 bytes of headroom
@@ -686,9 +684,9 @@ main (int argc, char **argv)
        case PROCESS_SLOT_VAR:
          if (strchr (optarg, '='))
            {
-             die (EXIT_FAILURE, 0,
-                  _("option --%s may not be set to a value which includes 
`='"),
-                  longopts[option_index].name);
+             error (EXIT_FAILURE, 0,
+                    _("option --%s may not be set to a value which includes 
`='"),
+                    longopts[option_index].name);
            }
          slot_var_name = optarg;
          if (0 != unsetenv (slot_var_name))
@@ -698,9 +696,9 @@ main (int argc, char **argv)
                 have the same value for this variable; see
                 set_slot_var.
              */
-             die (EXIT_FAILURE, errno,
-                  _("failed to unset environment variable %s"),
-                  slot_var_name);
+             error (EXIT_FAILURE, errno,
+                    _("failed to unset environment variable %s"),
+                    slot_var_name);
            }
          break;
 
@@ -755,9 +753,9 @@ main (int argc, char **argv)
       input_stream = fopen_cloexec_for_read_only (input_file);
       if (NULL == input_stream)
        {
-         die (EXIT_FAILURE, errno,
-              _("Cannot open input file %s"),
-              quotearg_n_style (0, locale_quoting_style, input_file));
+         error (EXIT_FAILURE, errno,
+                _("Cannot open input file %s"),
+                quotearg_n_style (0, locale_quoting_style, input_file));
        }
     }
 
@@ -932,10 +930,10 @@ read_line (void)
          if (state == QUOTE)
            {
              exec_if_possible ();
-             die (EXIT_FAILURE, 0,
-                  _("unmatched %s quote; by default quotes are special to "
-                    "xargs unless you use the -0 option"),
-                  quotc == '"' ? _("double") : _("single"));
+             error (EXIT_FAILURE, 0,
+                    _("unmatched %s quote; by default quotes are special to "
+                      "xargs unless you use the -0 option"),
+                    quotc == '"' ? _("double") : _("single"));
            }
          if (first && EOF_STR (linebuf))
            return -1;
@@ -1027,10 +1025,10 @@ read_line (void)
          if (c == '\n')
            {
              exec_if_possible ();
-             die (EXIT_FAILURE, 0,
-                  _("unmatched %s quote; by default quotes are special to "
-                    "xargs unless you use the -0 option"),
-                  quotc == '"' ? _("double") : _("single"));
+             error (EXIT_FAILURE, 0,
+                    _("unmatched %s quote; by default quotes are special to "
+                      "xargs unless you use the -0 option"),
+                    quotc == '"' ? _("double") : _("single"));
            }
          if (c == quotc)
            {
@@ -1059,7 +1057,7 @@ read_line (void)
       if (p >= endbuf)
         {
          exec_if_possible ();
-         die (EXIT_FAILURE, 0, _("argument line too long"));
+         error (EXIT_FAILURE, 0, _("argument line too long"));
        }
       *p++ = c;
 #else
@@ -1124,7 +1122,7 @@ read_string (void)
       if (p >= endbuf)
         {
          exec_if_possible ();
-         die (EXIT_FAILURE, 0, _("argument line too long"));
+         error (EXIT_FAILURE, 0, _("argument line too long"));
        }
       *p++ = c;
     }
@@ -1146,7 +1144,7 @@ print_args (bool ask)
                   (i == 0 ? "" : " "),
                   quotearg_n_style (0, shell_escape_quoting_style,
                                     bc_state.cmd_argv[i])) < 0)
-       die (EXIT_FAILURE, errno, _("Failed to write to stderr"));
+       error (EXIT_FAILURE, errno, _("Failed to write to stderr"));
     }
 
   if (ask)
@@ -1158,18 +1156,18 @@ print_args (bool ask)
        {
          tty_stream = fopen_cloexec_for_read_only ("/dev/tty");
          if (!tty_stream)
-           die (EXIT_FAILURE, errno,
-                _("failed to open /dev/tty for reading"));
+           error (EXIT_FAILURE, errno,
+                  _("failed to open /dev/tty for reading"));
        }
       fputs ("?...", stderr);
       if (fflush (stderr) != 0)
-       die (EXIT_FAILURE, errno, _("Failed to write to stderr"));
+       error (EXIT_FAILURE, errno, _("Failed to write to stderr"));
 
       c = savec = getc (tty_stream);
       while (c != EOF && c != '\n')
        c = getc (tty_stream);
       if (EOF == c)
-       die (EXIT_FAILURE, errno, _("Failed to read from stdin"));
+       error (EXIT_FAILURE, errno, _("Failed to read from stdin"));
       if (savec == 'y' || savec == 'Y')
        return true;
     }
@@ -1246,8 +1244,8 @@ prep_child_for_exec (void)
           */
          if (open_tty)
            {
-             die (EXIT_FAILURE, errno, "%s",
-                  quotearg_n_style (0, locale_quoting_style, inputfile));
+             error (EXIT_FAILURE, errno, "%s",
+                    quotearg_n_style (0, locale_quoting_style, inputfile));
            }
          else
            {
@@ -1258,8 +1256,8 @@ prep_child_for_exec (void)
       if (STDIN_FILENO < fd)
        {
          if (dup2(fd, STDIN_FILENO) != 0)
-           die (EXIT_FAILURE, errno,
-                _("failed to redirect standard input of the child process"));
+           error (EXIT_FAILURE, errno,
+                  _("failed to redirect standard input of the child process"));
          close(fd);
        }
     }
@@ -1311,7 +1309,7 @@ xargs_do_exec (struct buildcmd_control *ctl, void 
*usercontext, int argc, char *
       wait_for_proc (false, 0u);
 
       if (pipe (fd))
-       die (EXIT_FAILURE, errno, _("could not create pipe before fork"));
+       error (EXIT_FAILURE, errno, _("could not create pipe before fork"));
       fcntl (fd[1], F_SETFD, FD_CLOEXEC);
 
       /* If we run out of processes, wait for a child to return and
@@ -1322,7 +1320,7 @@ xargs_do_exec (struct buildcmd_control *ctl, void 
*usercontext, int argc, char *
       switch (child)
        {
        case -1:
-         die (EXIT_FAILURE, errno, _("cannot fork"));
+         error (EXIT_FAILURE, errno, _("cannot fork"));
 
        case 0:         /* Child.  */
          {
@@ -1434,9 +1432,9 @@ xargs_do_exec (struct buildcmd_control *ctl, void 
*usercontext, int argc, char *
          }
        default:
          {
-           die (EXIT_FAILURE, errno,
-                _("read returned unexpected value %"PRIuMAX"; "
-                  "this is probably a bug, please report it"), r);
+           error (EXIT_FAILURE, errno,
+                  _("read returned unexpected value %"PRIuMAX"; "
+                    "this is probably a bug, please report it"), r);
          }
        } /* switch on bytes read */
       close (fd[0]);
@@ -1527,8 +1525,8 @@ wait_for_proc (bool all, unsigned int minreap)
          while ((pid = waitpid (-1, &status, wflags)) == (pid_t) -1)
            {
              if (errno != EINTR)
-               die (EXIT_FAILURE, errno,
-                    _("error waiting for child process"));
+               error (EXIT_FAILURE, errno,
+                      _("error waiting for child process"));
 
              if (stop_waiting && !all)
                {
-- 
2.42.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]