Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
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
nexedi
MariaDB
Commits
20b3c155
Commit
20b3c155
authored
Mar 10, 2008
by
msvensson@pilot.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve error message dir -> croak
parent
afefb65c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
mysql-test/lib/My/SafeProcess.pm
mysql-test/lib/My/SafeProcess.pm
+8
-8
No files found.
mysql-test/lib/My/SafeProcess.pm
View file @
20b3c155
...
@@ -49,7 +49,7 @@ package My::SafeProcess;
...
@@ -49,7 +49,7 @@ package My::SafeProcess;
#
#
use
strict
;
use
strict
;
use
Carp
;
use
POSIX
qw(WNOHANG)
;
use
POSIX
qw(WNOHANG)
;
use
My::SafeProcess::
Base
;
use
My::SafeProcess::
Base
;
...
@@ -73,7 +73,7 @@ END {
...
@@ -73,7 +73,7 @@ END {
sub
is_child
{
sub
is_child
{
my
(
$self
,
$parent_pid
)
=
@_
;
my
(
$self
,
$parent_pid
)
=
@_
;
die
"
usage:
\
$safe_proc
->is_child()
"
unless
(
@_
==
2
and
ref
$self
);
croak
"
usage:
\
$safe_proc
->is_child()
"
unless
(
@_
==
2
and
ref
$self
);
return
(
$self
->
{
PARENT
}
==
$parent_pid
);
return
(
$self
->
{
PARENT
}
==
$parent_pid
);
}
}
...
@@ -124,8 +124,8 @@ sub new {
...
@@ -124,8 +124,8 @@ sub new {
@_
@_
);
);
my
$path
=
delete
(
$opts
{'
path
'})
or
die
"
path required
@_
";
my
$path
=
delete
(
$opts
{'
path
'})
or
croak
"
path required
@_
";
my
$args
=
delete
(
$opts
{'
args
'})
or
die
"
args required
@_
";
my
$args
=
delete
(
$opts
{'
args
'})
or
croak
"
args required
@_
";
my
$input
=
delete
(
$opts
{'
input
'});
my
$input
=
delete
(
$opts
{'
input
'});
my
$output
=
delete
(
$opts
{'
output
'});
my
$output
=
delete
(
$opts
{'
output
'});
my
$error
=
delete
(
$opts
{'
error
'});
my
$error
=
delete
(
$opts
{'
error
'});
...
@@ -198,7 +198,7 @@ sub run {
...
@@ -198,7 +198,7 @@ sub run {
#
#
sub
timer
{
sub
timer
{
my
$class
=
shift
;
my
$class
=
shift
;
my
$duration
=
shift
or
die
"
duration required
";
my
$duration
=
shift
or
croak
"
duration required
";
my
$parent_pid
=
$$
;
my
$parent_pid
=
$$
;
my
$pid
=
My::SafeProcess::Base::
_safe_fork
();
my
$pid
=
My::SafeProcess::Base::
_safe_fork
();
...
@@ -296,7 +296,7 @@ sub shutdown {
...
@@ -296,7 +296,7 @@ sub shutdown {
#
#
sub
start_kill
{
sub
start_kill
{
my
(
$self
)
=
@_
;
my
(
$self
)
=
@_
;
die
"
usage:
\
$safe_proc
->start_kill()
"
unless
(
@_
==
1
and
ref
$self
);
croak
"
usage:
\
$safe_proc
->start_kill()
"
unless
(
@_
==
1
and
ref
$self
);
#print "start_kill $self\n";
#print "start_kill $self\n";
if
(
defined
$safe_kill
and
$self
->
{
SAFE_WINPID
}){
if
(
defined
$safe_kill
and
$self
->
{
SAFE_WINPID
}){
...
@@ -321,7 +321,7 @@ sub start_kill {
...
@@ -321,7 +321,7 @@ sub start_kill {
#
#
sub
kill
{
sub
kill
{
my
(
$self
)
=
@_
;
my
(
$self
)
=
@_
;
die
"
usage:
\
$safe_proc
->kill()
"
unless
(
@_
==
1
and
ref
$self
);
croak
"
usage:
\
$safe_proc
->kill()
"
unless
(
@_
==
1
and
ref
$self
);
$self
->
start_kill
();
$self
->
start_kill
();
$self
->
wait_one
();
$self
->
wait_one
();
...
@@ -355,7 +355,7 @@ sub _collect {
...
@@ -355,7 +355,7 @@ sub _collect {
#
#
sub
wait_one
{
sub
wait_one
{
my
(
$self
,
$timeout
)
=
@_
;
my
(
$self
,
$timeout
)
=
@_
;
die
"
usage:
\
$safe_proc
->wait_one([timeout])
"
unless
ref
$self
;
croak
"
usage:
\
$safe_proc
->wait_one([timeout])
"
unless
ref
$self
;
#print "wait_one $self, $timeout\n";
#print "wait_one $self, $timeout\n";
...
...
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