소스 검색

Kernel: socket() with SOCK_CLOEXEC was setting the wrong fd flag.

Turns out FD_CLOEXEC and O_CLOEXEC are different values. Silly mistake.
I noticed that Terminal's shell process still had the Terminal's window
server connection open, albeit in a broken state.
Andreas Kling 6 년 전
부모
커밋
7bb00ea1e3
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      Kernel/Process.cpp

+ 1 - 1
Kernel/Process.cpp

@@ -2236,7 +2236,7 @@ int Process::sys$socket(int domain, int type, int protocol)
     auto descriptor = FileDescriptor::create(move(socket));
     unsigned flags = 0;
     if (type & SOCK_CLOEXEC)
-        flags |= O_CLOEXEC;
+        flags |= FD_CLOEXEC;
     if (type & SOCK_NONBLOCK)
         descriptor->set_blocking(false);
     m_fds[fd].set(move(descriptor), flags);