bug-gnulib
[Top][All Lists]
Advanced

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

clean-temp: fix wrong errno in error message


From: Bruno Haible
Subject: clean-temp: fix wrong errno in error message
Date: Sun, 28 Jun 2020 15:48:18 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-179-generic; KDE/5.18.0; x86_64; ; )

A simple fix.


2020-06-28  Bruno Haible  <bruno@clisp.org>

        clean-temp: Fix wrong errno in error message.
        * lib/clean-temp.c (create_temp_dir): Save errno around
        unblock_fatal_signals call.

diff --git a/lib/clean-temp.c b/lib/clean-temp.c
index b9badac..e56428c 100644
--- a/lib/clean-temp.c
+++ b/lib/clean-temp.c
@@ -332,6 +332,7 @@ create_temp_dir (const char *prefix, const char *parentdir,
     }
   block_fatal_signals ();
   tmpdirname = mkdtemp (xtemplate);
+  int saved_errno = errno;
   if (tmpdirname != NULL)
     {
       tmpdir->dirname = tmpdirname;
@@ -340,7 +341,7 @@ create_temp_dir (const char *prefix, const char *parentdir,
   unblock_fatal_signals ();
   if (tmpdirname == NULL)
     {
-      error (0, errno,
+      error (0, saved_errno,
              _("cannot create a temporary directory using template \"%s\""),
              xtemplate);
       goto quit;




reply via email to

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