lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> Sending the original error message instead of a potential fclose
> related one is not a bug fix, it's an improvement. You can substitute
> the wole errfile() with "pushstring("IOERROR"), return LUA_ERRFILE"
> and still will not be a bug.

Thanks for explaining this.

A global 'errno' is a tragedy. A global 'errno' that *any* library
function can change is a bigger tragedy.

There are several other places in Lua with calls between a potential
error and a use of 'errno' that can change 'errno'. Each one adds only
a few lines of code to be "corrected", but they also create a mentality
that is not healthy, in my opinion (the notion that you can use 'errno'
properly :-), and of course they add complexity to the code.

Any reported error is an error that actually happened, but that might
not be the "original" error in an operation, the error you might be
expecting. As I asked before, unless someone can point me to real issues
caused by this approach, we will keep it.  (As Francisco pointed out,
we are talking about something like "a close operation interrupted by a
signal corrupting the error code created by a previous read".)

So, we can *improve* some uses of 'errno', if the change is really
simple. (We judge that against the return from that change, which seems
to be close to zero.) But please do not call that a bug, and let us not
try to fix every use of 'errno'.

-- Roberto
_______________________________________________
lua-l mailing list -- lua-l@lists.lua.org
To unsubscribe send an email to lua-l-leave@lists.lua.org