>From db6d5f7240c8a743aebb3def80b3e3fabf05f0c1 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 6 Jan 2019 17:22:37 -0800 Subject: [PATCH 2/2] diff: use xstdopen, not stdopen * bootstrap.conf (gnulib_modules): * src/cmp.c, src/diff.c, src/diff3.c, src/sdiff.c (main): Use xstdopen, not stdopen. --- bootstrap.conf | 2 +- src/cmp.c | 6 ++---- src/diff.c | 6 ++---- src/diff3.c | 6 ++---- src/sdiff.c | 6 ++---- 5 files changed, 9 insertions(+), 17 deletions(-) diff --git a/bootstrap.conf b/bootstrap.conf index 0c9fbfe..4671349 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -67,7 +67,6 @@ stat stat-macros stat-time stdint -stdopen strcase strftime strptime @@ -85,6 +84,7 @@ wcwidth xalloc xfreopen xreadlink +xstdopen xstrtoumax xvasprintf ' diff --git a/src/cmp.c b/src/cmp.c index 811d039..ce2bdb5 100644 --- a/src/cmp.c +++ b/src/cmp.c @@ -31,11 +31,11 @@ #include #include #include -#include #include #include #include #include +#include #include /* The official name of this program (e.g., no 'g' prefix). */ @@ -210,9 +210,7 @@ main (int argc, char **argv) bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); c_stack_action (0); - int stdopen_errno = stdopen (); - if (stdopen_errno != 0) - error (EXIT_TROUBLE, stdopen_errno, _("standard file descriptors")); + xstdopen (); /* Parse command line options. */ diff --git a/src/diff.c b/src/diff.c index 541d912..e9c2b11 100644 --- a/src/diff.c +++ b/src/diff.c @@ -37,11 +37,11 @@ #include #include #include -#include #include #include #include #include +#include #include /* The official name of this program (e.g., no 'g' prefix). */ @@ -298,9 +298,7 @@ main (int argc, char **argv) re_set_syntax (RE_SYNTAX_GREP | RE_NO_POSIX_BACKTRACKING); excluded = new_exclude (); presume_output_tty = false; - int stdopen_errno = stdopen (); - if (stdopen_errno != 0) - error (EXIT_TROUBLE, stdopen_errno, _("standard file descriptors")); + xstdopen (); /* Decode the options. */ diff --git a/src/diff3.c b/src/diff3.c index 8ce1a3d..037df25 100644 --- a/src/diff3.c +++ b/src/diff3.c @@ -30,11 +30,11 @@ #include #include #include -#include #include #include #include #include +#include /* The official name of this program (e.g., no 'g' prefix). */ #define PROGRAM_NAME "diff3" @@ -273,9 +273,7 @@ main (int argc, char **argv) bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); c_stack_action (0); - int stdopen_errno = stdopen (); - if (stdopen_errno != 0) - error (EXIT_TROUBLE, stdopen_errno, _("standard file descriptors")); + xstdopen (); while ((c = getopt_long (argc, argv, "aeimvx3AEL:TX", longopts, 0)) != -1) { diff --git a/src/sdiff.c b/src/sdiff.c index 605fd33..2ef83da 100644 --- a/src/sdiff.c +++ b/src/sdiff.c @@ -32,10 +32,10 @@ #include #include #include -#include #include #include #include +#include /* The official name of this program (e.g., no 'g' prefix). */ #define PROGRAM_NAME "sdiff" @@ -456,9 +456,7 @@ main (int argc, char *argv[]) bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); c_stack_action (cleanup); - int stdopen_errno = stdopen (); - if (stdopen_errno != 0) - error (EXIT_TROUBLE, stdopen_errno, _("standard file descriptors")); + xstdopen (); prog = getenv ("EDITOR"); if (prog) -- 2.17.1