From: JongHeonChoi Date: Tue, 29 Nov 2022 04:11:07 +0000 (+0900) Subject: Change the return value to a non-zero in case of failure (#3525) X-Git-Tag: accepted/tizen/unified/riscv/20231226.055542~45^2^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a7f87ef1aed1ad77a749a10f0e6c12d5a1d16536;p=platform%2Fcore%2Fdotnet%2Fdiagnostics.git Change the return value to a non-zero in case of failure (#3525) --- diff --git a/src/Tools/dotnet-dump/Dumper.cs b/src/Tools/dotnet-dump/Dumper.cs index 95716fe1c..5b34ff856 100644 --- a/src/Tools/dotnet-dump/Dumper.cs +++ b/src/Tools/dotnet-dump/Dumper.cs @@ -42,24 +42,24 @@ namespace Microsoft.Diagnostics.Tools.Dump if (processId != 0) { Console.WriteLine("Can only specify either --name or --process-id option."); - return 0; + return -1; } processId = CommandUtils.FindProcessIdWithName(name); if (processId < 0) { - return 0; + return -1; } } if (processId == 0) { Console.Error.WriteLine("ProcessId is required."); - return 1; + return -1; } if (processId < 0) { Console.Error.WriteLine($"The PID cannot be negative: {processId}"); - return 1; + return -1; } try @@ -98,7 +98,7 @@ namespace Microsoft.Diagnostics.Tools.Dump if (crashreport) { Console.WriteLine("Crash reports not supported on Windows."); - return 0; + return -1; } Windows.CollectDump(processId, output, type); @@ -150,7 +150,7 @@ namespace Microsoft.Diagnostics.Tools.Dump ex is DiagnosticsClientException) { console.Error.WriteLine($"{ex.Message}"); - return 1; + return -1; } console.Out.WriteLine($"Complete");