Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5798ca5

Browse files
committed
Improve TestLib::system_or_bail error reporting
The original coding was not quoting the complete failing command, and itwasn'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
1 parent64919aa commit5798ca5

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

‎src/test/perl/TestLib.pm

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,9 +375,29 @@ sub system_or_bail
375375
{
376376
if (system_log(@_) != 0)
377377
{
378-
BAIL_OUT("system$_[0] failed");
378+
if ($? == -1)
379+
{
380+
BAIL_OUT(
381+
sprintf(
382+
"failed to execute command\"%s\":$!",join("",@_)));
383+
}
384+
elsif ($? & 127)
385+
{
386+
BAIL_OUT(
387+
sprintf(
388+
"command\"%s\" died with signal%d",
389+
join("",@_),
390+
$? & 127));
391+
}
392+
else
393+
{
394+
BAIL_OUT(
395+
sprintf(
396+
"command\"%s\" exited with value%d",
397+
join("",@_),
398+
$? >> 8));
399+
}
379400
}
380-
return;
381401
}
382402

383403
=pod

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp