]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
util/editenv: Don't use %m formatter
authorVladimir Serbinenko <phcoder@gmail.com>
Thu, 24 Aug 2023 20:32:45 +0000 (22:32 +0200)
committerDaniel Kiper <daniel.kiper@oracle.com>
Tue, 12 Dec 2023 16:55:14 +0000 (17:55 +0100)
It's not available on NetBSD outside of syslog. Using strerror() is more
reliable as we retrieve errno immediately rather than down the stack.

Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
util/editenv.c

index c532b046f0e3510eae940f219630ad1c79ee2ca4..63a50304094dd3c5a2908a0ddd16e8ffd2a5916c 100644 (file)
@@ -91,7 +91,7 @@ grub_util_create_envblk_file (const char *name)
       else if (retsize < 0)
         {
           free (linkbuf);
-          grub_util_error (_("cannot rename the file %s to %s: %m"), namenew, name);
+          grub_util_error (_("cannot rename the file %s to %s: %s"), namenew, name, strerror (errno));
         }
       else if (retsize == size)
         {
@@ -128,7 +128,7 @@ grub_util_create_envblk_file (const char *name)
   free (rename_target);
 
   if (rc < 0)
-    grub_util_error (_("cannot rename the file %s to %s: %m"), namenew, name);
+    grub_util_error (_("cannot rename the file %s to %s: %s"), namenew, name, strerror (errno));
 #endif
 
   free (namenew);