TextMate is a graphical text editor for OS X 10.7+
修訂 | c7f267cd12fc253c0844720fb05c010614aa89a1 (tree) |
---|---|
時間 | 2012-08-18 22:30:24 |
作者 | Allan Odgaard <git@abet...> |
Commiter | Allan Odgaard |
Show error if failing to unlink old socket
This is in response to issue #183.
@@ -124,7 +124,11 @@ namespace | ||
124 | 124 | mate_server_t () : _socket_path(path::join(path::temp(), "textmate.sock")) |
125 | 125 | { |
126 | 126 | D(DBF_RMateServer, bug("%s\n", _socket_path.c_str());); |
127 | - unlink(_socket_path.c_str()); | |
127 | + if(unlink(_socket_path.c_str()) == -1 && errno != ENOENT) | |
128 | + { | |
129 | + OakRunIOAlertPanel("Unable to delete socket left from old instance:\n%s", _socket_path.c_str()); | |
130 | + return; | |
131 | + } | |
128 | 132 | |
129 | 133 | socket_t fd(socket(AF_UNIX, SOCK_STREAM, 0)); |
130 | 134 | fcntl(fd, F_SETFD, 1); |