Checking return status for system()