Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1ee94739 authored by Elliott Hughes's avatar Elliott Hughes
Browse files

O_CLOEXEC != FD_CLOEXEC.

And worse, the kernel silently ignores unrecognized flags, so this
wasn't even failing, it was just doing nothing.

Test: treehugger
Change-Id: I98fb98df8fc3882c73fa8bd7e31947a7f9c3a58d
parent 9d718b1d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -41,7 +41,7 @@ PosixAsyncSocket::PosixAsyncSocket(int fd, AsyncManager* am)
  fcntl(fd, F_SETFL, flags | O_NONBLOCK);

  flags = fcntl(fd, F_GETFD);
  fcntl(fd, F_SETFD, flags | O_CLOEXEC);
  fcntl(fd, F_SETFD, flags | FD_CLOEXEC);

#ifdef SO_NOSIGPIPE
  // Disable SIGPIPE generation on Darwin.