changed active to allow for active=<n>, save errno when debug logging