fix an issue

This commit is contained in:
Max Lv
2015-07-22 18:34:18 +08:00
parent fd4015fac2
commit 2f7424d07b
2 changed files with 4 additions and 2 deletions
+3 -1
View File
@@ -502,9 +502,11 @@ int main (int argc, char **argv)
goto fail2;
}
char *path = "/data/data/com.github.shadowsocks/sock_path";
unlink(path);
memset(&addr, 0, sizeof(addr));
addr.sun_family = AF_UNIX;
strncpy(addr.sun_path, "/data/data/com.github.shadowsocks/sock_path", sizeof(addr.sun_path)-1);
strncpy(addr.sun_path, path, sizeof(addr.sun_path)-1);
if (bind(sock, (struct sockaddr*)&addr, sizeof(addr)) == -1) {
BLog(BLOG_ERROR, "bind() failed: %s (sock = %d)\n", strerror(errno), sock);
@@ -336,7 +336,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
if (BuildConfig.DEBUG) Log.d(TAG, cmd)
Console.runCommand(cmd.mkString(" "))
Console.runCommand(cmd)
return fd;
}