From 6e1704ad4ca5afa970d9f9d02d1f7cb855fe394b Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Tue, 8 Aug 2006 22:00:44 +0000 Subject: [PATCH] * verror.c (verror_at_line): Work around glibc bug 2997, so that verror_at_line output complies with GNU Coding Standards even when file is NULL. --- lib/ChangeLog | 6 ++++++ lib/verror.c | 10 +++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/lib/ChangeLog b/lib/ChangeLog index 38f2578b0c..c356e990a2 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,9 @@ +2006-08-08 Eric Blake + + * verror.c (verror_at_line): Work around glibc bug 2997, so that + verror_at_line output complies with GNU Coding Standards even when + file is NULL. + 2006-08-08 Eric Blake * verror.h, verror.c: New files. diff --git a/lib/verror.c b/lib/verror.c index f9c869ec84..3011ab5f30 100644 --- a/lib/verror.c +++ b/lib/verror.c @@ -59,7 +59,15 @@ verror_at_line (int status, int errnum, const char *file, { char *message = xvasprintf (format, args); if (message) - error_at_line (status, errnum, file, line_number, "%s", message); + { + /* Until http://sourceware.org/bugzilla/show_bug.cgi?id=2997 is fixed, + glibc violates GNU Coding Standards when the file argument to + error_at_line is NULL. */ + if (file) + error_at_line (status, errnum, file, line_number, "%s", message); + else + error (status, errnum, "%s", message); + } else { /* EOVERFLOW, EINVAL, and EILSEQ from xvasprintf are signs of -- 2.30.2