Talk:POSIX Error Handling

From LSDevLinux
Revision as of 23:47, 11 June 2008 by Mayhewn (talk | contribs) (Some questions/comments)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

A couple of questions/comments:

  1. Would the preservation of errno fit better inside the if block? I don't think the test for "evidence of error" could change errno, and it might be good to localize the scope of the saved errno variable ("errorNumber").
  2. I'm not sure why you are using strerror_r rather than strerror. Since strerror returns a pointer to static data that will not move, there are no multi-threading or lifetime issues to consider. This would simplify the code a good deal, and strerror could be called inside the argument list of printf.

--Neil 23:47, 11 June 2008 (MDT)