Article View: news.software.nntp
Article #40461Re: Diablo debugging problems...
From: Russ Allbery
Date: Mon, 04 Oct 1999 00:00
Date: Mon, 04 Oct 1999 00:00
23 lines
1592 bytes
1592 bytes
Brad Knowles <brad@shub-internet.org> writes: > Russ Allbery <rra@stanford.edu> wrote: >> In this case it contains 0, which syslog() (probably via strerror()) >> recognizes as not being an actual error code, producing the "Undefined >> error" message. > Ahh, I see. So I need to check the return code before I send that to > syslog, so that I don't log an unnecessary error. Yeah, in general you only log with %m or use strerror() or perror() or what have you if some system call failed and it's documented to set errno. Otherwise, the value may be some unuseful junk left over from something else. In the code you were quoting, the return value of write() had already been checked and I don't believe the syslog() call was reachable if write() had returned -1. -- Russ Allbery (rra@stanford.edu) <URL:http://www.eyrie.org/~eagle/>
Technical Details
Message-ID:
<ylg0zqaja4.fsf@windlord.stanford.edu>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mailReferences:
<brad-0110991517500001@brad.techos.skynet.be> <37f4e0b3$0$10188@news.execpc.com> <brad-0410991834410001@brad.techos.skynet.be> <yl670ndpwz.fsf@windlord.stanford.edu> <brad-0410992339180001@dialup1042.brussels2.skynet.be>Show Full Headers
Complete Article Headers
Message-ID: <ylg0zqaja4.fsf@windlord.stanford.edu> Subject: Re: Diablo debugging problems... Date: Mon, 04 Oct 1999 00:00:00 +0000 From: Russ Allbery <rra@stanford.edu> References: <brad-0110991517500001@brad.techos.skynet.be> <37f4e0b3$0$10188@news.execpc.com> <brad-0410991834410001@brad.techos.skynet.be> <yl670ndpwz.fsf@windlord.stanford.edu> <brad-0410992339180001@dialup1042.brussels2.skynet.be> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail X-Deja-AN: 532821983 Organization: The Eyrie Newsgroups: news.software.nntp