Thread View: pdx.utek
2 messages
2 total messages
Started by Bill Trost
Wed, 30 Dec 1992 21:38
stdio bug in UTek 4.0?
Author: Bill Trost
Date: Wed, 30 Dec 1992 21:38
Date: Wed, 30 Dec 1992 21:38
24 lines
1145 bytes
1145 bytes
I've been working on bring up smail 3.1.27 on a UTek 4.0 box, and I've
encountered a strange problem with the alias-reader routines. The
loop basically runs like
while ((*s++ = getc(fp)) != EOL && !EOF)
...
}
if (alias matched)
return rhs;
if (ferror(fp))
return FAIL;
return NOT_FOUND;
Now, under 4.0, if the end of the file is reached (instead of finding
an alias), ferror(fp) returns true, and the associated errno is ENOENT
(never mind the file was opened and read successfully).
Is this a known error in UTek 4.0, or worse yet, a "feature"? Is
there a way to fix this behaviour, or do I have to kludge around it?
Thanks for any help....
--
Bill Trost <trost@cse.ogi.edu> All signatures are virii.
Re: stdio bug in UTek 4.0?
Author: Bill Trost
Date: Thu, 31 Dec 1992 00:05
Date: Thu, 31 Dec 1992 00:05
15 lines
1232 bytes
1232 bytes
In article <TROST.92Dec30133811@ogicse.cse.ogi.edu> trost@ogicse.cse.ogi.edu (Bill Trost) writes: while ((*s++ = getc(fp)) != EOL && !EOF) No, the code isn't really that bad. I didn't have it in front of me at the time of posting, so I just sketched it -- poorly. Anyhow, given a few helpful mail responses to the problem, I was lead to trace the problem to a read of the file after EOF had already been see, putting the FILE into an error state. The workaround, alas, is not to prevent a read past EOF, but to check ferror sooner...ag. Anyhow, thanks to one and all for the help! -- Bill Trost <trost@cse.ogi.edu> Space is nature's way of keeping everything from happening all in one spot.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads