fix some issues

This commit is contained in:
Max Lv
2015-07-24 14:07:53 +08:00
parent 15010013a4
commit 87fb636545
4 changed files with 7 additions and 7 deletions
+3 -3
View File
@@ -182,14 +182,14 @@ int protect_socket(void (*protect_cb)(int ret, void *data), void *data, int fd)
int remotefd;
struct sockaddr_un addr;
// Setup
setnonblocking(remotefd);
if ( (remotefd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) {
LOGE("[android] socket() failed: %s (socket fd = %d)\n", strerror(errno), remotefd);
return -1;
}
// Setup
setnonblocking(remotefd);
memset(&addr, 0, sizeof(addr));
addr.sun_family = AF_UNIX;
strncpy(addr.sun_path, "/data/data/com.github.shadowsocks/protect_path", sizeof(addr.sun_path)-1);