libc:lib_psfa_dddup2,add return check
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
This commit is contained in:
parent
367fa640c1
commit
fcdc7afcb5
@ -89,8 +89,17 @@ int posix_spawn_file_actions_adddup2(
|
||||
/* NOTE: Workaround to avoid an error when executing dup2 action */
|
||||
|
||||
flags = fcntl(fd1, F_GETFD);
|
||||
if (flags < 0)
|
||||
{
|
||||
return flags;
|
||||
}
|
||||
|
||||
flags &= ~FD_CLOEXEC;
|
||||
fcntl(fd1, F_SETFD, flags);
|
||||
flags = fcntl(fd1, F_SETFD, flags);
|
||||
if (flags < 0)
|
||||
{
|
||||
return flags;
|
||||
}
|
||||
|
||||
/* And add it to the file action list */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user