From: Konrad Kuchciak Date: Wed, 24 Mar 2021 07:56:47 +0000 (+0100) Subject: Adjust to the new version of livedump_pid() X-Git-Tag: submit/tizen/20210324.085352~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=03f33f59d7e6973201098a81c1593c46b16de9eb;p=platform%2Fcore%2Fapi%2Fdiagnostics.git Adjust to the new version of livedump_pid() Change-Id: I198b66f4faf363dfc100127dc491f36cf49fd66f Signed-off-by: Konrad Kuchciak --- diff --git a/src/library/diagnostics.c b/src/library/diagnostics.c index 203a42b..2ccb0f2 100644 --- a/src/library/diagnostics.c +++ b/src/library/diagnostics.c @@ -793,14 +793,19 @@ int diagnostics_request_bugreport(int pid) return DIAGNOSTICS_ERROR_IO_ERROR; } - /* - * TODO: livedump_pid() should be changed to return - * TIZEN_ERROR_PERMISSION_DENIED in case of missing permission - * TIZEN_ERROR_INVALID_PARAMETER in case of no such process - */ ret = livedump_pid(pid > 0 ? pid : 0, reason, report_path, PATH_MAX); - if (ret == false) + if (ret) { + if (ret == TIZEN_ERROR_PERMISSION_DENIED) { + _E("Permission error, check privilege"); + return DIAGNOSTICS_ERROR_PERMISSION_DENIED; + } + if (ret == TIZEN_ERROR_NO_SUCH_PROCESS) { + _E("No such process: %d", pid); + return DIAGNOSTICS_ERROR_INVALID_PARAMETER; + } + _E("livedump_pid() failed: %d", ret); return DIAGNOSTICS_ERROR_IO_ERROR; + } return DIAGNOSTICS_ERROR_NONE; }