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 <phcoder@gmail.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
Vladimir Serbinenko 2023-08-24 22:32:45 +02:00 committed by Daniel Kiper
parent f5905f6566
commit 31e47cfe2c

View File

@ -91,7 +91,7 @@ grub_util_create_envblk_file (const char *name)
else if (retsize < 0) else if (retsize < 0)
{ {
free (linkbuf); 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) else if (retsize == size)
{ {
@ -128,7 +128,7 @@ grub_util_create_envblk_file (const char *name)
free (rename_target); free (rename_target);
if (rc < 0) 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 #endif
free (namenew); free (namenew);