Possible cleanup

Hal Murray hmurray at megapathdsl.net
Sun Jul 24 08:44:37 UTC 2016

There is a SAVE_ERRNO macro that wraps around some code to preserve errno.  
It's only used in a few places.  The first place I saw was calling msyslog.  
That would make sense if following code did something that depended on the 
error, but I checked all 4 cases and they never looked at errno.  They are 
all in ntp_refclock.

Looks like we can rip it out.  But that's not the sort of code that's easy to 
test so we should be careful.

SAVE_ERRNO uses a socket_errno() macro to get errno.  That looks like it's a 
hook to work with windows.  The answer gets put back into errno.

Ahhh.  the SAVE_ERRNO macro isn't being used to save errno but rather to copy 
the windows error over to errno where %m in msyslog can get it.

I wonder if we can push that into msyslog.  Looks like it's already there.

So either we can rip it out, or we have to fix all the other places that use 

(Or I haven't analyzed things correctly.)

These are my opinions.  I hate spam.

More information about the devel mailing list