• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javaandroidc++linuxc#objective-ccocoa誰得qtrubypythonwindowsphpgamebathyscapheguic翻訳omegattwitterframeworkbtronvb.net計画中(planning stage)testdomarduinodirectxpreviewerゲームエンジン

TextMate is a graphical text editor for OS X 10.7+


Commit MetaInfo

Revision9b8daf674a8edfad746212dce433eac7a8529c08 (tree)
Time2012-08-24 03:28:54
AuthorAllan Odgaard <git@abet...>
CommiterAllan Odgaard

Log Message

Use symbolic name for FD_CLOEXEC

Unsure why I was using ‘1’ — perhaps the symbolic name was missing in the older SDK.

Change Summary

Incremental Difference

--- a/Applications/TextMate/src/RMateServer.cc
+++ b/Applications/TextMate/src/RMateServer.cc
@@ -136,7 +136,7 @@ namespace
136136 }
137137
138138 socket_t fd(socket(AF_UNIX, SOCK_STREAM, 0));
139- fcntl(fd, F_SETFD, 1);
139+ fcntl(fd, F_SETFD, FD_CLOEXEC);
140140 struct sockaddr_un addr = { 0, AF_UNIX };
141141 strcpy(addr.sun_path, _socket_path);
142142 addr.sun_len = SUN_LEN(&addr);
@@ -169,7 +169,7 @@ namespace
169169 socket_t fd(socket(AF_INET, SOCK_STREAM, 0));
170170 setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
171171
172- fcntl(fd, F_SETFD, 1);
172+ fcntl(fd, F_SETFD, FD_CLOEXEC);
173173 struct sockaddr_in iaddr = { sizeof(sockaddr_in), AF_INET, htons(_port), { htonl(_ip) } };
174174 if(-1 == bind(fd, (sockaddr*)&iaddr, sizeof(iaddr)))
175175 fprintf(stderr, "bind(): %s\n", strerror(errno));
--- a/Frameworks/editor/src/write.cc
+++ b/Frameworks/editor/src/write.cc
@@ -31,7 +31,7 @@ namespace
3131 {
3232 client_key = server().register_client(this);
3333 int newFd = dup(fd);
34- fcntl(newFd, F_SETFD, 1);
34+ fcntl(newFd, F_SETFD, FD_CLOEXEC);
3535 server().send_request(client_key, (request_t){ newFd, str });
3636 }
3737
--- a/Frameworks/file/src/filter.cc
+++ b/Frameworks/file/src/filter.cc
@@ -67,7 +67,7 @@ namespace filter
6767 {
6868 _client_key = write_server().register_client(this);
6969 int newFd = dup(fd);
70- fcntl(newFd, F_SETFD, 1);
70+ fcntl(newFd, F_SETFD, FD_CLOEXEC);
7171 write_server().send_request(_client_key, (request_t){ newFd, bytes });
7272 }
7373
--- a/Frameworks/io/src/pipe.cc
+++ b/Frameworks/io/src/pipe.cc
@@ -10,8 +10,8 @@ namespace io
1010 write_pipe = pipes[1];
1111 if(close_on_exec)
1212 {
13- fcntl(pipes[0], F_SETFD, 1);
14- fcntl(pipes[1], F_SETFD, 1);
13+ fcntl(pipes[0], F_SETFD, FD_CLOEXEC);
14+ fcntl(pipes[1], F_SETFD, FD_CLOEXEC);
1515 }
1616 }
1717
--- a/Frameworks/io/src/socket.h
+++ b/Frameworks/io/src/socket.h
@@ -17,7 +17,7 @@ private:
1717 {
1818 WATCH_LEAKS(helper_t);
1919
20- helper_t (int fd) : fd(fd) { if(fd != -1) fcntl(fd, F_SETFD, 1); }
20+ helper_t (int fd) : fd(fd) { if(fd != -1) fcntl(fd, F_SETFD, FD_CLOEXEC); }
2121 ~helper_t () { if(fd != -1) close(fd); }
2222 int fd;
2323 };
--- a/Frameworks/network/src/filter_tbz.h
+++ b/Frameworks/network/src/filter_tbz.h
@@ -99,8 +99,8 @@ namespace network
9999 {
100100 close(input[0]);
101101 close(output[1]);
102- fcntl(input[1], F_SETFD, 1);
103- fcntl(output[0], F_SETFD, 1);
102+ fcntl(input[1], F_SETFD, FD_CLOEXEC);
103+ fcntl(output[0], F_SETFD, FD_CLOEXEC);
104104 }
105105 return true;
106106 }
--- a/Frameworks/network/src/tbz.cc
+++ b/Frameworks/network/src/tbz.cc
@@ -48,8 +48,8 @@ namespace network
4848 }
4949 else
5050 {
51- fcntl(input = in[1], F_SETFD, 1);
52- fcntl(output = out[0], F_SETFD, 1);
51+ fcntl(input = in[1], F_SETFD, FD_CLOEXEC);
52+ fcntl(output = out[0], F_SETFD, FD_CLOEXEC);
5353 }
5454 }
5555 return pid;