mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
check: only call setpgid on valid child PIDs
Coverity 206186
This commit is contained in:
parent
9c821554fc
commit
b9313afc75
1 changed files with 2 additions and 1 deletions
|
@ -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__);
|
||||
|
|
Loading…
Reference in a new issue