delcypher added a comment. @kcc I've added a bunch of error checking in this patch too and also replace `fclose()` with `pclose()`. If you don't like these changes I can remove this so this patch only adds Mac OSX support and nothing else. http://reviews.llvm.org/D20409