]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Fix the exit code when toolbox-cmd disk shrink is canceled.
authorJohn Wolfe <jwolfe@vmware.com>
Tue, 22 Sep 2020 21:54:07 +0000 (14:54 -0700)
committerJohn Wolfe <jwolfe@vmware.com>
Tue, 22 Sep 2020 21:54:07 +0000 (14:54 -0700)
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

open-vm-tools/toolbox/toolboxCmdInt.h
open-vm-tools/toolbox/toolboxcmd-shrink.c

index c251f40196b694a2a8f4aad3e678962627cb2ade..73b713f5ae108a09f28a9b9e87e3b8b0af18fd4e 100644 (file)
@@ -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
 #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
index 9597d7bf4ea69014adc6d5617d5bc0717633febb..ea4265f8a8483632b7d0f7b6760f70575ffef895 100644 (file)
@@ -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