@@ -72,14 +72,14 @@ int TerminationCheck(int status, const Descriptor *cmdstat,
72
72
CheckAndCopyCharsToDescriptor (cmdmsg, " Execution error" );
73
73
}
74
74
}
75
+
75
76
#ifdef _WIN32
76
77
// On WIN32 API std::system returns exit status directly
77
78
int exitStatusVal{status};
78
- if (exitStatusVal == 1 ) {
79
79
#else
80
80
int exitStatusVal{WEXITSTATUS (status)};
81
- if (exitStatusVal == 127 || exitStatusVal == 126 ) {
82
81
#endif
82
+ if (exitStatusVal != 0 ) {
83
83
if (!cmdstat) {
84
84
terminator.Crash (
85
85
" Invalid command quit with exit status code: %d" , exitStatusVal);
@@ -88,23 +88,25 @@ int TerminationCheck(int status, const Descriptor *cmdstat,
88
88
CheckAndCopyCharsToDescriptor (cmdmsg, " Invalid command line" );
89
89
}
90
90
}
91
+
91
92
#if defined(WIFSIGNALED) && defined(WTERMSIG)
92
93
if (WIFSIGNALED (status)) {
93
94
if (!cmdstat) {
94
- terminator.Crash (" killed by signal: %d" , WTERMSIG (status));
95
+ terminator.Crash (" Killed by signal: %d" , WTERMSIG (status));
95
96
} else {
96
97
StoreIntToDescriptor (cmdstat, SIGNAL_ERR, terminator);
97
- CheckAndCopyCharsToDescriptor (cmdmsg, " killed by signal" );
98
+ CheckAndCopyCharsToDescriptor (cmdmsg, " Killed by signal" );
98
99
}
99
100
}
100
101
#endif
102
+
101
103
#if defined(WIFSTOPPED) && defined(WSTOPSIG)
102
104
if (WIFSTOPPED (status)) {
103
105
if (!cmdstat) {
104
- terminator.Crash (" stopped by signal: %d" , WSTOPSIG (status));
106
+ terminator.Crash (" Stopped by signal: %d" , WSTOPSIG (status));
105
107
} else {
106
108
StoreIntToDescriptor (cmdstat, SIGNAL_ERR, terminator);
107
- CheckAndCopyCharsToDescriptor (cmdmsg, " stopped by signal" );
109
+ CheckAndCopyCharsToDescriptor (cmdmsg, " Stopped by signal" );
108
110
}
109
111
}
110
112
#endif
0 commit comments