mirror of
https://github.com/apache/nuttx.git
synced 2025-01-13 09:49:21 +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:
parent
04db52612e
commit
b2ff151282
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue