Fix darwin build (error.PutToLog fallout)

llvm-svn: 294222
This commit is contained in:
Pavel Labath 2017-02-06 19:31:02 +00:00
parent 60199c1a4d
commit 2f8d5739b5
1 changed files with 6 additions and 18 deletions

View File

@ -957,9 +957,7 @@ static Error getXPCAuthorization(ProcessLaunchInfo &launch_info) {
if (createStatus != errAuthorizationSuccess) { if (createStatus != errAuthorizationSuccess) {
error.SetError(1, eErrorTypeGeneric); error.SetError(1, eErrorTypeGeneric);
error.SetErrorString("Can't create authorizationRef."); error.SetErrorString("Can't create authorizationRef.");
if (log) { LLDB_LOG(log, "error: {0}", error);
error.PutToLog(log, "%s", error.AsCString());
}
return error; return error;
} }
@ -1012,9 +1010,7 @@ static Error getXPCAuthorization(ProcessLaunchInfo &launch_info) {
error.SetError(2, eErrorTypeGeneric); error.SetError(2, eErrorTypeGeneric);
error.SetErrorStringWithFormat( error.SetErrorStringWithFormat(
"Launching as root needs root authorization."); "Launching as root needs root authorization.");
if (log) { LLDB_LOG(log, "error: {0}", error);
error.PutToLog(log, "%s", error.AsCString());
}
if (authorizationRef) { if (authorizationRef) {
AuthorizationFree(authorizationRef, kAuthorizationFlagDefaults); AuthorizationFree(authorizationRef, kAuthorizationFlagDefaults);
@ -1050,9 +1046,7 @@ static Error LaunchProcessXPC(const char *exe_path,
error.SetError(3, eErrorTypeGeneric); error.SetError(3, eErrorTypeGeneric);
error.SetErrorStringWithFormat("Launching root via XPC needs to " error.SetErrorStringWithFormat("Launching root via XPC needs to "
"externalize authorization reference."); "externalize authorization reference.");
if (log) { LLDB_LOG(log, "error: {0}", error);
error.PutToLog(log, "%s", error.AsCString());
}
return error; return error;
} }
xpc_service = LaunchUsingXPCRightName; xpc_service = LaunchUsingXPCRightName;
@ -1060,9 +1054,7 @@ static Error LaunchProcessXPC(const char *exe_path,
error.SetError(4, eErrorTypeGeneric); error.SetError(4, eErrorTypeGeneric);
error.SetErrorStringWithFormat( error.SetErrorStringWithFormat(
"Launching via XPC is only currently available for root."); "Launching via XPC is only currently available for root.");
if (log) { LLDB_LOG(log, "error: {0}", error);
error.PutToLog(log, "%s", error.AsCString());
}
return error; return error;
} }
@ -1146,9 +1138,7 @@ static Error LaunchProcessXPC(const char *exe_path,
error.SetErrorStringWithFormat( error.SetErrorStringWithFormat(
"Problems with launching via XPC. Error type : %i, code : %i", "Problems with launching via XPC. Error type : %i, code : %i",
errorType, errorCode); errorType, errorCode);
if (log) { LLDB_LOG(log, "error: {0}", error);
error.PutToLog(log, "%s", error.AsCString());
}
if (authorizationRef) { if (authorizationRef) {
AuthorizationFree(authorizationRef, kAuthorizationFlagDefaults); AuthorizationFree(authorizationRef, kAuthorizationFlagDefaults);
@ -1160,9 +1150,7 @@ static Error LaunchProcessXPC(const char *exe_path,
error.SetErrorStringWithFormat( error.SetErrorStringWithFormat(
"Problems with launching via XPC. XPC error : %s", "Problems with launching via XPC. XPC error : %s",
xpc_dictionary_get_string(reply, XPC_ERROR_KEY_DESCRIPTION)); xpc_dictionary_get_string(reply, XPC_ERROR_KEY_DESCRIPTION));
if (log) { LLDB_LOG(log, "error: {0}", error);
error.PutToLog(log, "%s", error.AsCString());
}
} }
return error; return error;