On Monday 15 of April 2013 14:54:59 Denys Vlasenko wrote:
On 04/11/2013 11:16 AM, Jakub Filak wrote:
> Define macro for exit code saying that user canceled the operation. We
> want to be able to distinguish between fatal errors and user requests
> because we want to react in different ways in frontends.
>
> The code is 69 and there is no special reason for it. (except it must be
> in range 0-255)
>
> The current implementation allows programmers to set a global variable
> xfunc_error_retval to any value nevertheless the new function hiding the
> global variable was added in order to support bindings to other
> languages.
>
> Related to #146
>
> Signed-off-by: Jakub Filak <jfilak(a)redhat.com>
> ---
>
> src/client-python/debuginfo.py | 3 ++-
> src/include/internal_libreport.h | 5 +++++
> src/lib/logging.c | 5 +++++
> src/plugins/reporter-bugzilla.c | 6 ++++++
> src/plugins/reporter-print.c | 3 +++
> src/report-python/reportmodule.c | 3 +++
> 6 files changed, 24 insertions(+), 1 deletion(-)
>
> diff --git a/src/client-python/debuginfo.py
> b/src/client-python/debuginfo.py index 4d4bffa..cbba0f3 100644
> --- a/src/client-python/debuginfo.py
> +++ b/src/client-python/debuginfo.py
> @@ -1,6 +1,7 @@
>
> from subprocess import Popen, PIPE
> from yum import _, YumBase
> from yum.callbacks import DownloadBaseCallback
>
> +from report import EXIT_CANCELED_BY_USER as RETURN_CANCELED_BY_USER
I don't think rename is useful.
I did it only to keep the name in consistency with RETURN_FAIL ... :)
"EXIT_CANCELED_BY_USER" itself is also not ideal.
"exit canceled"? No, it wasn't canceled,
it's "exit code which means 'Canceled'".
I propose to name it EXITCODE_CANCELED_BY_USER.
I wanted to make it consistent with EXIT_SUCCESS and EXIT_FAILURE
Other than this, it builds and works good :)
Should I send a new version or is this version OK with my explanantion?