Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
f8721bd7
Commit
f8721bd7
authored
Oct 22, 2020
by
Peter Eisentraut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use croak instead of die in Perl code when appropriate
parent
e7c2b95d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
src/test/perl/TestLib.pm
src/test/perl/TestLib.pm
+7
-6
No files found.
src/test/perl/TestLib.pm
View file @
f8721bd7
...
...
@@ -43,6 +43,7 @@ package TestLib;
use
strict
;
use
warnings
;
use
Carp
;
use
Config
;
use
Cwd
;
use
Exporter
'
import
';
...
...
@@ -421,7 +422,7 @@ sub slurp_dir
{
my
(
$dir
)
=
@_
;
opendir
(
my
$dh
,
$dir
)
or
die
"
could not opendir
\"
$dir
\"
: $!
";
or
croak
"
could not opendir
\"
$dir
\"
: $!
";
my
@direntries
=
readdir
$dh
;
closedir
$dh
;
return
@direntries
;
...
...
@@ -443,19 +444,19 @@ sub slurp_file
if
(
$Config
{
osname
}
ne
'
MSWin32
')
{
open
(
my
$in
,
'
<
',
$filename
)
or
die
"
could not read
\"
$filename
\"
: $!
";
or
croak
"
could not read
\"
$filename
\"
: $!
";
$contents
=
<
$in
>
;
close
$in
;
}
else
{
my
$fHandle
=
createFile
(
$filename
,
"
r
",
"
rwd
")
or
die
"
could not open
\"
$filename
\"
: $^E
";
or
croak
"
could not open
\"
$filename
\"
: $^E
";
OsFHandleOpen
(
my
$fh
=
IO::
Handle
->
new
(),
$fHandle
,
'
r
')
or
die
"
could not read
\"
$filename
\"
: $^E
\n
";
or
croak
"
could not read
\"
$filename
\"
: $^E
\n
";
$contents
=
<
$fh
>
;
CloseHandle
(
$fHandle
)
or
die
"
could not close
\"
$filename
\"
: $^E
\n
";
or
croak
"
could not close
\"
$filename
\"
: $^E
\n
";
}
$contents
=~
s/\r\n/\n/g
if
$Config
{
osname
}
eq
'
msys
';
return
$contents
;
...
...
@@ -474,7 +475,7 @@ sub append_to_file
{
my
(
$filename
,
$str
)
=
@_
;
open
my
$fh
,
"
>>
",
$filename
or
die
"
could not write
\"
$filename
\"
: $!
";
or
croak
"
could not write
\"
$filename
\"
: $!
";
print
$fh
$str
;
close
$fh
;
return
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment