GNU bug report logs - #15425
mktemp - conflicting options affected by ENV

Previous Next

Package: coreutils;

Reported by: Assaf Gordon <assafgordon <at> gmail.com>

Date: Fri, 20 Sep 2013 16:47:02 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Pádraig Brady <P <at> draigBrady.com>
To: 15425 <at> debbugs.gnu.org
Subject: bug#15425: mktemp - conflicting options affected by ENV
Date: Mon, 07 Oct 2013 12:22:30 +0100
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 <P <at> draigBrady.com>
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;
         }
     }





This bug report was last modified 11 years and 227 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.