forkfd/linux: handle failure from sys_clone

Pick-to: 5.15
Change-Id: I98a28a816fdc089cefcbf8f42053ddffedc10cdf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Andreas Schwab 2020-06-19 10:49:17 +02:00 committed by Thiago Macieira
parent 5dc4004afc
commit b7bdd854cb

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;