This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] localedef: include file name in error messages
- From: Mike Frysinger <vapier at gentoo dot org>
- To: libc-alpha at sourceware dot org
- Date: Sat, 25 May 2013 14:40:30 -0400
- Subject: [PATCH] localedef: include file name in error messages
When mkstemp fails, the error message the user gets back is:
cannot create temporary file: No such file or directory
That isn't terribly useful in figuring out why, so include the full
filename we tried to create in the error output.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2013-05-23 Mike Frysinger <vapier@gentoo.org>
* locale/programs/locarchive.c (create_archive): Inlucde fname in
error message.
(enlarge_archive): Likewise.
---
locale/programs/locarchive.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/locale/programs/locarchive.c b/locale/programs/locarchive.c
index 53bea55..9a7d8b0 100644
--- a/locale/programs/locarchive.c
+++ b/locale/programs/locarchive.c
@@ -122,7 +122,7 @@ create_archive (const char *archivefname, struct locarhandle *ah)
/* Create a temporary file in the correct directory. */
fd = mkstemp (fname);
if (fd == -1)
- error (EXIT_FAILURE, errno, _("cannot create temporary file"));
+ error (EXIT_FAILURE, errno, _("cannot create temporary file: %s"), fname);
/* Create the initial content of the archive. */
head.magic = AR_MAGIC;
@@ -364,7 +364,7 @@ enlarge_archive (struct locarhandle *ah, const struct locarhead *head)
/* Create a temporary file in the correct directory. */
fd = mkstemp (fname);
if (fd == -1)
- error (EXIT_FAILURE, errno, _("cannot create temporary file"));
+ error (EXIT_FAILURE, errno, _("cannot create temporary file: %s"), fname);
/* Copy the existing head information. */
newhead = *head;
--
1.8.2.1