fs/vfs/fs_ioctl.c: Call F_GETFD to avoid clear other flag we will add in the future

This commit is contained in:
Yoshinori Sugino 2020-09-16 16:53:56 +09:00 committed by Xiang Xiao
parent d4ec1ababd
commit 5eefe8609c

View File

@ -195,10 +195,10 @@ int nx_vioctl(int fd, int req, va_list ap)
}
break;
case FIOCLEX:
ret = nx_fcntl(fd, F_SETFD, FD_CLOEXEC);
ret = nx_fcntl(fd, F_SETFD, nx_fcntl(fd, F_GETFD) | FD_CLOEXEC);
break;
case FIONCLEX:
ret = nx_fcntl(fd, F_SETFD, 0);
ret = nx_fcntl(fd, F_SETFD, nx_fcntl(fd, F_GETFD) & ~FD_CLOEXEC);
break;
}
}