tests: Correct return code handling

Reviewed-by: Marek Chalupa <mchqwerty@gmail.com>
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
This commit is contained in:
Bryce Harrington 2015-01-09 16:05:12 -08:00
parent 2eeb2cbc52
commit 9386e2be27

View File

@ -255,13 +255,13 @@ is_debugger_attached(void)
{
int status;
int rc;
int pid = fork();
pid_t pid = fork();
if (pid == -1)
return 0;
if (pid == 0) {
int ppid = getppid();
pid_t ppid = getppid();
if (ptrace(PTRACE_ATTACH, ppid, NULL, NULL) == 0) {
waitpid(ppid, NULL, 0);
ptrace(PTRACE_CONT, NULL, NULL);