Ah, wait a sec! The code in src/inet.c doesn't set the errno! If the returned value is != 0 just return err.