Possible cleanup
Eric S. Raymond
esr at thyrsus.com
Fri Aug 26 15:20:15 UTC 2016
Hal Murray <hmurray at megapathdsl.net>:
>
> 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
> %m.
>
> (Or I haven't analyzed things correctly.)
This macro is only used in the Windows port code. I think the answer is going
to be that we drop all that crap and rely on the Windows emulation environment
to supply adjtime(2) as will as the POSIX interfaces.
Mark knows a Microsoft guy who he thinks can get this done. That conversation
is on his to-do list.
--
<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>
More information about the devel
mailing list