Goto Jail, go directly to jail.
Am I the only one to get nervous about the use of 'goto' statements in the code?
If (err == 0) goto retry;
Huh? Does zero mean no error, in which case why are they retrying, or is it a recoverable error, in which case why not use the appropriate constant?
I don't know who approved it or why, but I can see why they didn't spot this problem. I don't know what other problems they have missed but I am sure they are there.
For a story about the benefits of open source, you have picked a very poor example.