fix hostname resolution
enable gethostbyname_r on illumos
fix whitespace issues