Message79626
> That's all fine, but why do you need a variable named "e" in
> the first place? Can't you leave the code as it was before?"
There is an intermediate call to a function that retrieves the
thread's ID. That function may or may not change the output of
GetLastError(). It probably won't change errno, since it is just
implemented as a call to the win32 API GetCurrentThreadId(). Still,
when I have a function that fails and provides additional info through
errno or GetLastError(), I personally prefer to save that value ASAP
instead of relying on the fact that some call in between doesn't touch
it.
I don't really care too much about this piece of code, since it's just
debug output, but in other cases (like #4906) making such distinction
is crucial. Since people might read and copy the code, I prefer to
give them a good example. If you feel differently, just drop me a note
and I'll change it. |
|
Date |
User |
Action |
Args |
2009-01-11 20:43:38 | eckhardt | set | recipients:
+ eckhardt, loewis, mhammond |
2009-01-11 20:43:35 | eckhardt | set | messageid: <1231706615.56.0.124096260237.issue4893@psf.upfronthosting.co.za> |
2009-01-11 20:43:34 | eckhardt | link | issue4893 messages |
2009-01-11 20:43:33 | eckhardt | create | |
|