Change call to exit to use EXIT_FAILURE (not -1).