🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #40477

Re: Diablo debugging problems...

#40477
From: Brad Knowles
Date: Mon, 04 Oct 1999 00:00
63 lines
2967 bytes
In article <37f4e0b3$0$10188@news.execpc.com>, jgreco@ns.sol.net (Joe
Greco) wrote:

> Try changing the write calls to "xwrite", and insert this at the top
> of diab-filter.c.

    Based on the other code in diab-filter.c, I added the following:

> int xwrite(fd, buf, siz)
> int fd;
> char *buf;
> int siz;
> {
>         register int rval, chrs = 0;
> 
>         while (siz) {
>                 if ((rval = write(fd, buf, siz)) < 0) {
>                         return(rval);
>                 }

                if (siz > rval) {
                        syslog(LOG_WARNING, "filter partial success: wanted to w
rite %d, wrote %d: %m", siz, rval);
                }
>                 chrs += rval;
>                 siz -= rval;
>                 buf += rval;
>         }
>         return(chrs);
> }

    However, I'm rather confused by the "...: %m" argument being handed to
syslog().  It's replicated throughout all syslog calls I can find in this
code, and yet there doesn't seem to be a corresponding value being printed
with that "%m" format, nor can I find that format in the man page for the
printf() family.

    On output, I get the following:

Oct  4 17:28:10 seymour diablo[43889]: filter partial success: wanted to
write 131903, wrote 131072: Undefined error: 0
Oct  4 17:30:39 seymour diablo[43889]: filter partial success: wanted to
write 30240, wrote 131072: Undefined error: 0
Oct  4 18:00:10 seymour diablo[44559]: filter partial success: wanted to
write 182901, wrote 65536 : Undefined error: 0
Oct  4 18:20:31 seymour diablo[44559]: filter partial success: wanted to
write 107920, wrote 65536 : Undefined error: 0

    It would seem to me that the "%m" on that call to syslog() should be
removed, so as to eliminate the "Undefined error: 0" portion of the
message.


    Am I missing something here?

-- 
Brad Knowles <brad@shub-internet.org> <http://www.shub-internet.org/brad/>

Are you a USENET news server administrator outside of North America or
Western Europe?  Would you like a newsfeed from a site in the Freenix
Top 100?  If so, please contact me via private e-mail for details.

Technical Details
Message-ID: <brad-0410991834410001@brad.techos.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
References: <brad-0110991517500001@brad.techos.skynet.be> <37f4e0b3$0$10188@news.execpc.com>

Show Full Headers
Complete Article Headers
Message-ID: <brad-0410991834410001@brad.techos.skynet.be>
Subject: Re: Diablo debugging problems...
Date: Mon, 04 Oct 1999 00:00:00 +0000
From: brad@shub-internet.org (Brad Knowles)
References: <brad-0110991517500001@brad.techos.skynet.be> <37f4e0b3$0$10188@news.execpc.com>
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: 532704149
X-Complaints-To: abuse@skynet.be
X-Trace: news0.skynet.be 939054897 22789 195.238.1.121 (4 Oct 1999 16:34:57 GMT)
Organization: Shub-Internet
X-URL: http://www.shub-internet.org/
NNTP-Posting-Date: 4 Oct 1999 16:34:57 GMT
Newsgroups: news.software.nntp