Instead of randomly using -1 or 1 as a failure status, properly utilize the EXIT_FAILURE define that's platform specific (as it should be). (cherry picked from commit76997983fde02d9c32aa23bda30b65f1ebd4178c)