mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
vmcp: Change sequence of failed exit
When vmcp fails to execute a CP command with both error conditions - response buffer is too small - CP command failed then the vmcp program exits with 'response buffer too small' indication. However, an exit code indicating 'CP command failed' would be more important in this case. So change the vmcp exit code and return 'CP command failed' for above error scenario. Signed-off-by: Thomas Richter <tmricht@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
committed by
Jan Höppner
parent
e08e07baa9
commit
53b949926f
10
vmcp/vmcp.c
10
vmcp/vmcp.c
@@ -235,15 +235,15 @@ int main(int argc, char **argv)
|
||||
write_buffer(STDOUT_FILENO, cp.response,
|
||||
MIN(cp.response_size, cp.buffer_size));
|
||||
free(cp.response);
|
||||
if (ret == VMCP_ERR_TOOSMALL) {
|
||||
fprintf(stderr, "Error: output (%d bytes) was truncated, try "
|
||||
"--buffer to increase size\n", cp.response_size);
|
||||
return VMCP_BUF;
|
||||
}
|
||||
if (cp.cprc > 0) {
|
||||
fprintf(stderr, "Error: non-zero CP response for command '%s': "
|
||||
"#%d\n", command, cp.cprc);
|
||||
return VMCP_CP;
|
||||
}
|
||||
if (ret == VMCP_ERR_TOOSMALL) {
|
||||
fprintf(stderr, "Error: output (%d bytes) was truncated, try "
|
||||
"--buffer to increase size\n", cp.response_size);
|
||||
return VMCP_BUF;
|
||||
}
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user