[Mimedefang] putc failed: Error 0 line 848

Alberto.daSilva at rmb.co.za Alberto.daSilva at rmb.co.za
Wed Nov 13 11:05:01 EST 2002


> On Mon, 11 Nov 2002, Steffen Kaiser wrote:
>
>> This is very unlikely, there is about 10GB unused space and there is no
>> other sign except these log entries.
>
> OK; then Solaris's putc implementation has a bug. :-)
>
> The code in question is:
>
>          if (putc(*s, data->fp) == EOF) {
>                    syslog(LOG_WARNING, "putc failed: %m line %d",
__LINE__);
>          }
>
> "putc" should return EOF only on failure, and should then set errno.
It's
> returning EOF, but not setting errno (that's the "Error 0").
>
> Now, "s" is a pointer to unsigned char, and should never be cast to EOF
> as the result of a putc(), but that could be what's happening.

I'm running MD 2.25 on Solaris 8 SPARC, built with gcc 3.2 and
I've also been getting the same error:
     putc failed: Error 0 line 863

The problem is when *s = 0xff.
putc returns -1 == EOF

int putc(int c, FILE *stream)
     Upon     successful     completion,     fputc(),     putc(),
     putc_unlocked(),  putchar(),  and  putchar_unlocked() return
     the value that  was  written.   Otherwise,  these  functions
     return  EOF,  the error indicator for the stream is set, and
     errno is set to indicate the error.

Sorry I'm not fluent enuf in C to suggest a fix.

Hope this helps

Alberto da Silva





More information about the MIMEDefang mailing list