From: Vladimir Serbinenko Date: Thu, 24 Aug 2023 20:32:45 +0000 (+0200) Subject: util/editenv: Don't use %m formatter X-Git-Tag: grub-2.12~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=31e47cfe2c3958afd1faacf387c0bf8da33560a9;p=thirdparty%2Fgrub.git util/editenv: Don't use %m formatter 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 Reviewed-by: Daniel Kiper --- diff --git a/util/editenv.c b/util/editenv.c index c532b046f..63a503040 100644 --- a/util/editenv.c +++ b/util/editenv.c @@ -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);