Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
criu
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhul
criu
Commits
fd214e00
Commit
fd214e00
authored
Jun 25, 2014
by
Pavel Emelyanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: Helper for checking child exit status
Signed-off-by:
Pavel Emelyanov
<
xemul@parallels.com
>
parent
f929839a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
11 deletions
+16
-11
test_sub.c
test/libcriu/test_sub.c
+16
-11
No files found.
test/libcriu/test_sub.c
View file @
fd214e00
...
...
@@ -32,6 +32,21 @@ static void what_err_ret_mean(ret)
}
}
static
inline
int
chk_exit
(
int
status
,
int
want
)
{
if
(
WIFEXITED
(
status
))
{
if
(
WEXITSTATUS
(
status
)
==
want
)
return
0
;
printf
(
" `- FAIL (exit %d)
\n
"
,
WEXITSTATUS
(
status
));
}
else
if
(
WIFSIGNALED
(
status
))
printf
(
" `- FAIL (die %d)
\n
"
,
WTERMSIG
(
status
));
else
printf
(
" `- FAIL (%#x)
\n
"
,
status
);
return
1
;
}
static
int
stop
=
0
;
static
void
sh
(
int
sig
)
{
...
...
@@ -126,15 +141,5 @@ err:
return
-
1
;
}
if
(
WIFEXITED
(
ret
))
{
if
(
WEXITSTATUS
(
ret
)
==
SUCC_ECODE
)
printf
(
" `- Success
\n
"
);
else
printf
(
" `- FAIL ec is %d
\n
"
,
WEXITSTATUS
(
ret
));
}
else
if
(
WIFSIGNALED
(
ret
))
printf
(
" `- FAIL killed %d
\n
"
,
WTERMSIG
(
ret
));
else
printf
(
" `- FAIL bs %#x
\n
"
,
ret
);
return
0
;
return
chk_exit
(
ret
,
SUCC_ECODE
);
}
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