From: John Wolfe Date: Tue, 22 Sep 2020 21:54:07 +0000 (-0700) Subject: Fix the exit code when toolbox-cmd disk shrink is canceled. X-Git-Tag: stable-11.3.0~308 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a021b598a61aadccd7da931c7ab717312ca03c0f;p=thirdparty%2Fopen-vm-tools.git Fix the exit code when toolbox-cmd disk shrink is canceled. The toolbox-cmd disk shrink operation was exiting with status 0 when a SIGINT is received. A non-zero exit status is expected. Change the exit code to 130, which is the appropriate value according to TLDP: https://tldp.org/LDP/abs/html/exitcodes.html --- diff --git a/open-vm-tools/toolbox/toolboxCmdInt.h b/open-vm-tools/toolbox/toolboxCmdInt.h index c251f4019..73b713f5a 100644 --- a/open-vm-tools/toolbox/toolboxCmdInt.h +++ b/open-vm-tools/toolbox/toolboxCmdInt.h @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2008-2019 VMware, Inc. All rights reserved. + * Copyright (C) 2008-2020 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -74,6 +74,10 @@ #define EX_NOPERM 77 /* permission denied */ #endif +#ifndef VM_EX_INTERRUPT +#define VM_EX_INTERRUPT 130 /* SIGINT received */ +#endif + /* * We want to have commands and arguments on Windows to be * case-instensitive, everywhere else we expect lowercase diff --git a/open-vm-tools/toolbox/toolboxcmd-shrink.c b/open-vm-tools/toolbox/toolboxcmd-shrink.c index 9597d7bf4..ea4265f8a 100644 --- a/open-vm-tools/toolbox/toolboxcmd-shrink.c +++ b/open-vm-tools/toolbox/toolboxcmd-shrink.c @@ -515,7 +515,7 @@ ShrinkWiperDestroy(int signal) // IN: Signal caught wiper = NULL; } ToolsCmd_Print("%s", SU_(disk.shrink.canceled, "Disk shrink canceled.\n")); - exit(EXIT_SUCCESS); + exit(VM_EX_INTERRUPT); } #endif