[fpc-devel] Weird output from fpGetErrNo
Ewald
ewald at yellowcouch.org
Thu Jan 31 16:29:07 CET 2013
Once upon a time, on 01/30/2013 11:38 PM to be precise, Tomas Hajny said:
>> If the above is right, than errno (without the `C`) contains a leftover
>> error from somewhere before in the program. What bothers me is: what (and
>> why) created the contition? (I know it is not some garbage data in the
>> variable, since it changes over time to another error: ENOTTY --> ENOENT)
> I don't think you need to worry too much. It's perfectly normal that
> certain functions used within RTL, etc., may end up in a failure code.
> Sometimes there's no other way for testing certain things than simply
> trying them and checking the result afterwards (and this may happen within
> the RTL and RTL itself needs to evaluate what should be cinsidered an
> error and what not).
This had actually occured to me, it wouldn't surprise me for example
that after calling `FileExists(<a nonexistant filename>)` you get ENOENT
(No Such File Or Directory) in errno as a leftover from FileExists,
which has interpreted this code and so decided to return false. In this
case ENOENT no longer has any meaning (or use for that matter). But then
there is ENOTTY. "Where could it come from" was what I was wondering
about, but as you and Marco say, I shouldn't worry too much about it.
And, since the program works flawlessly, it would be useless to go out
on a witchhunt chasing errors which most probably aren't errors at all.
Anyway, thanks for the explanation!
--
Ewald
More information about the fpc-devel
mailing list