Improve TestLib::system_or_bail error reporting
The original coding was not quoting the complete failing command, and it wasn't printing the reason for the failure either. Do both. This is cosmetic only, so no backpatch. Author: Álvaro Herrera <alvherre@alvh.no-ip.org> Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-by: Daniel Gustafsson <daniel@yesql.se> Discussion: https://postgr.es/m/202106301524.eq5pblzstapj@alvherre.pgsql
This commit is contained in:
parent
64919aaab4
commit
5798ca5299
@ -375,9 +375,29 @@ sub system_or_bail
|
||||
{
|
||||
if (system_log(@_) != 0)
|
||||
{
|
||||
BAIL_OUT("system $_[0] failed");
|
||||
if ($? == -1)
|
||||
{
|
||||
BAIL_OUT(
|
||||
sprintf(
|
||||
"failed to execute command \"%s\": $!", join(" ", @_)));
|
||||
}
|
||||
elsif ($? & 127)
|
||||
{
|
||||
BAIL_OUT(
|
||||
sprintf(
|
||||
"command \"%s\" died with signal %d",
|
||||
join(" ", @_),
|
||||
$? & 127));
|
||||
}
|
||||
else
|
||||
{
|
||||
BAIL_OUT(
|
||||
sprintf(
|
||||
"command \"%s\" exited with value %d",
|
||||
join(" ", @_),
|
||||
$? >> 8));
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
=pod
|
||||
|
Loading…
x
Reference in New Issue
Block a user