bug-coreutils
[Top][All Lists]
Advanced

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

bug#15425: mktemp - conflicting options affected by ENV


From: Pádraig Brady
Subject: bug#15425: mktemp - conflicting options affected by ENV
Date: Mon, 07 Oct 2013 12:22:30 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2

On 10/06/2013 06:10 PM, Pádraig Brady wrote:
> Also I matched the -q option up with the documentation.
> The documented functionality made sense, which was to
> suppress only I/O errors, but the existing code suppressed
> almost all errors, including most usage errors.
> So I fixed that up in a second patch.

I was caught out by inconsistent exit() handling in this area,
which required this follow up commit.

commit cba81e7b84f27385e254cddd065bb16c98a5d045
Author: Pádraig Brady <address@hidden>
Date:   Mon Oct 7 11:59:53 2013 +0100

    mktemp: fix incorrect exit status from previous commit

    * src/mktemp.c (main): Use an exit() strategy consistent with the
    previous clauses dealing with optional error messages to ensure
    we exit with the correct status in all cases.
    Prompted by the continuous integration build failure at:
    http://hydra.nixos.org/build/6412979

diff --git a/src/mktemp.c b/src/mktemp.c
index 05530a3..074676f 100644
--- a/src/mktemp.c
+++ b/src/mktemp.c
@@ -335,7 +335,8 @@ main (int argc, char **argv)
           int saved_errno = errno;
           remove (dest_name);
           if (!suppress_file_err)
-            error (EXIT_FAILURE, saved_errno, _("write error"));
+            error (0, saved_errno, _("write error"));
+          status = EXIT_FAILURE;
         }
     }






reply via email to

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