mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Strake <strake888@gmail.com>
To: musl@lists.openwall.com
Subject: [patch] err: print program name; was: Broken silent glibc-specific assumptions uncovered by musl
Date: Sat, 18 May 2013 08:01:35 -0500	[thread overview]
Message-ID: <CAL3m8eDRh0MryVY3Ak-CiWMzigKEkJcs3UmuAsW7ZKEV11UpOQ@mail.gmail.com> (raw)

On 18/05/2013, Szabolcs Nagy <nsz@port70.net> wrote:
> - musl's err does not print __progname, it might annoy one

Well, as we have it now:


From f96370aac0c33ae437f0b8f3fa0a946ace330eaa Mon Sep 17 00:00:00 2001
From: Strake <strake888@gmail.com>
Date: Sat, 18 May 2013 07:59:03 -0500
Subject: [PATCH] err: print program name

---
 src/legacy/err.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/legacy/err.c b/src/legacy/err.c
index 0f74853..7b167b3 100644
--- a/src/legacy/err.c
+++ b/src/legacy/err.c
@@ -3,14 +3,18 @@
 #include <stdarg.h>
 #include <stdlib.h>

+extern char *__progname;
+
 void vwarn(const char *fmt, va_list ap)
 {
+	fprintf (stderr, "%s: ", __progname);
 	if (fmt) vfprintf(stderr, fmt, ap);
 	perror("");
 }

 void vwarnx(const char *fmt, va_list ap)
 {
+	fprintf (stderr, "%s: ", __progname);
 	if (fmt) vfprintf(stderr, fmt, ap);
 	putc('\n', stderr);
 }
-- 
1.7.11.1


             reply	other threads:[~2013-05-18 13:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-18 13:01 Strake [this message]
2013-05-18 14:22 ` Rich Felker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAL3m8eDRh0MryVY3Ak-CiWMzigKEkJcs3UmuAsW7ZKEV11UpOQ@mail.gmail.com \
    --to=strake888@gmail.com \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).