forkfd/linux: handle failure from sys_clone

Pick-to: 5.15
Change-Id: I98a28a816fdc089cefcbf8f42053ddffedc10cdf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
bb10
Andreas Schwab 2020-06-19 10:49:17 +02:00 committed by Thiago Macieira
parent 5dc4004afc
commit b7bdd854cb
1 changed files with 2 additions and 0 deletions

View File

@ -151,6 +151,8 @@ int system_forkfd(int flags, pid_t *ppid, int *system)
if (flags & FFD_VFORK_SEMANTICS)
cloneflags |= CLONE_VFORK;
pid = sys_clone(cloneflags, &pidfd);
if (pid < 0)
return pid;
if (ppid)
*ppid = pid;