Commit 2fb750e8 authored by Borislav Petkov's avatar Borislav Petkov Committed by Frederic Weisbecker

perf-record: Check correct pid when forking

When forking the child to be traced, we should check the correct
return value from fork() and not a local variable which is otherwise
Signed-off-by: default avatarBorislav Petkov <>
Cc: Ingo Molnar <>
Cc: Peter Zijlstra <>
Cc: Arnaldo Carvalho de Melo <>
Cc: Paul Mackerras <>
Cc: Tom Zanussi <>
Cc: Stephane Eranian <>
LKML-Reference: <20100531211818.GA30175@liondog.tnic>
Signed-off-by: default avatarFrederic Weisbecker <>
parent dd833d71
......@@ -503,7 +503,6 @@ static int __cmd_record(int argc, const char **argv)
int i, counter;
struct stat st;
pid_t pid = 0;
int flags;
int err;
unsigned long waking = 0;
......@@ -572,7 +571,7 @@ static int __cmd_record(int argc, const char **argv)
if (forks) {
child_pid = fork();
if (pid < 0) {
if (child_pid < 0) {
perror("failed to fork");
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment