lua-users home
lua-l archive

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


Ops, you are right:
  The value of errno is zero at program startup, but is never set to
  zero by any library function.


Quoting the specifications, fclose can change errno.

My point is still valid:
in case of error the function must return the error message related to the failure.

Not the error message of the fclose.
It could be different; if different it is useless to troubleshoot the real problem.

Thanks for your attention,
M


On Thu, 14 May 2020, 17:57 Roberto Ierusalimschy, <roberto@inf.puc-rio.br> wrote:
> fclose can change errno.. . also reset it to zero.

It cannot reset it. ISO C ensures this:

  The value of errno is zero at program startup, but is never set to
  zero by any library function.

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