[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: error.c: "Unknown system error" should report errno value

From: Martin Koeppe
Subject: Re: error.c: "Unknown system error" should report errno value
Date: Tue, 25 Sep 2007 01:46:48 +0200 (CEST)

On Mon, 24 Sep 2007, Paul Eggert wrote:

Martin Koeppe <address@hidden> writes:

+      s = _("Unknown system error");
+      fprintf (stderr, ": %s (errno=%d)", s, errnum);

I like the idea, but that "errno=" grates a bit, as user diagnostics
shouldn't be so low-level.  How about this instead?

 fprintf (stderr, _(": Unknown system error number %d"), errnum);

Ok, I could live with that. My idea was not to change the original string to avoid re-translation and to give a clear hint what this number is meant to be, i.e. that's an errno value. The number alone is probably of no use to any "normal" user anyway. (Though I first had only "(%d)" myself.) OTOH if strerror() cannot resolve the errno value, then there is probably a bigger problem in it, not a normally occuring case (generating a user level diagnostic has just failed!), and debugging should be made easy. I also think it's a good idea to have ":" and "%d" not within the string for easy and uniform translations. That's probably why %s is used that often I could imagine.

But with your idea in a debug case one could grep through all the source files and would also find that it is an errno value which has been reported. So I'm not against your idea.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]