mirror of
https://github.com/apache/nuttx.git
synced 2026-05-27 03:05:40 +08:00
libc/fdcheck: if pid_expect is 0, fdcheck does not take effect
there are some user code like this:
/* close all inherited fds */
for (i = 3; i < maxfds; i++)
func (i);
Signed-off-by: hujun5 <hujun5@xiaomi.com>
This commit is contained in:
@@ -85,7 +85,7 @@ int fdcheck_restore(int val)
|
||||
pid_expect = (val >> PID_SHIFT);
|
||||
pid_now = (getpid() & PID_MASK);
|
||||
ppid_now = (getppid() & PID_MASK);
|
||||
if (pid_expect != pid_now && pid_expect != ppid_now)
|
||||
if (pid_expect != pid_now && pid_expect != ppid_now && pid_expect != 0)
|
||||
{
|
||||
ferr("pid_expect %d pid_now %d ppid_now %d\n",
|
||||
pid_expect, pid_now, ppid_now);
|
||||
|
||||
Reference in New Issue
Block a user