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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
adb94df2
Commit
adb94df2
authored
Aug 18, 2005
by
kent@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mtr_process.pl:
Bug#11792: Create a shell like 'mysqltest' exit status
parent
1dddccb8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
14 deletions
+20
-14
mysql-test/lib/mtr_process.pl
mysql-test/lib/mtr_process.pl
+20
-14
No files found.
mysql-test/lib/mtr_process.pl
View file @
adb94df2
...
@@ -185,10 +185,6 @@ sub spawn_parent_impl {
...
@@ -185,10 +185,6 @@ sub spawn_parent_impl {
if
(
$mode
eq
'
run
'
or
$mode
eq
'
test
'
)
if
(
$mode
eq
'
run
'
or
$mode
eq
'
test
'
)
{
{
my
$exit_value
=
-
1
;
# my $signal_num= 0;
# my $dumped_core= 0;
if
(
$mode
eq
'
run
'
)
if
(
$mode
eq
'
run
'
)
{
{
# Simple run of command, we wait for it to return
# Simple run of command, we wait for it to return
...
@@ -199,12 +195,7 @@ sub spawn_parent_impl {
...
@@ -199,12 +195,7 @@ sub spawn_parent_impl {
mtr_error
("
$path
(
$pid
) got lost somehow
");
mtr_error
("
$path
(
$pid
) got lost somehow
");
}
}
$exit_value
=
$?
;
return
mtr_process_exit_status
(
$?
);
# $exit_value= $? >> 8;
# $signal_num= $? & 127;
# $dumped_core= $? & 128;
return
$exit_value
;
}
}
else
else
{
{
...
@@ -218,6 +209,7 @@ sub spawn_parent_impl {
...
@@ -218,6 +209,7 @@ sub spawn_parent_impl {
# FIXME is this as it should be? Can't mysqld terminate
# FIXME is this as it should be? Can't mysqld terminate
# normally from running a test case?
# normally from running a test case?
my
$exit_value
=
-
1
;
my
$ret_pid
;
# What waitpid() returns
my
$ret_pid
;
# What waitpid() returns
while
(
(
$ret_pid
=
waitpid
(
-
1
,
0
))
!=
-
1
)
while
(
(
$ret_pid
=
waitpid
(
-
1
,
0
))
!=
-
1
)
...
@@ -230,10 +222,7 @@ sub spawn_parent_impl {
...
@@ -230,10 +222,7 @@ sub spawn_parent_impl {
if
(
$ret_pid
==
$pid
)
if
(
$ret_pid
==
$pid
)
{
{
# We got termination of mysqltest, we are done
# We got termination of mysqltest, we are done
$exit_value
=
$?
;
$exit_value
=
mtr_process_exit_status
(
$?
);
# $exit_value= $? >> 8;
# $signal_num= $? & 127;
# $dumped_core= $? & 128;
last
;
last
;
}
}
...
@@ -292,6 +281,23 @@ sub spawn_parent_impl {
...
@@ -292,6 +281,23 @@ sub spawn_parent_impl {
}
}
# ----------------------------------------------------------------------
# We try to emulate how an Unix shell calculates the exit code
# ----------------------------------------------------------------------
sub
mtr_process_exit_status
{
my
$raw_status
=
shift
;
if
(
$raw_status
&
127
)
{
return
(
$raw_status
&
127
)
+
128
;
# Signal num + 128
}
else
{
return
$raw_status
>>
8
;
# Exit code
}
}
##############################################################################
##############################################################################
#
#
...
...
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