From: Vincent Penquerc'h Date: Mon, 7 Apr 2014 14:38:09 +0000 (+0100) Subject: check: only call setpgid on valid child PIDs X-Git-Tag: 1.3.1~58 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b9313afc75b68d986e473b76b55543456857912b;p=platform%2Fupstream%2Fgstreamer.git check: only call setpgid on valid child PIDs Coverity 206186 --- diff --git a/libs/gst/check/libcheck/check_run.c b/libs/gst/check/libcheck/check_run.c index 0c7b815..9390cd9 100644 --- a/libs/gst/check/libcheck/check_run.c +++ b/libs/gst/check/libcheck/check_run.c @@ -571,7 +571,8 @@ check_fork (void) #ifdef _POSIX_VERSION pid_t pid = fork (); /* Set the process to a process group to be able to kill it easily. */ - setpgid (pid, group_pid); + if (pid > 0) + setpgid (pid, group_pid); return pid; #else /* _POSIX_VERSION */ eprintf ("This version does not support fork", __FILE__, __LINE__);