Commit 2f7424d0 authored by Max Lv's avatar Max Lv

fix an issue

parent fd4015fa
...@@ -502,9 +502,11 @@ int main (int argc, char **argv) ...@@ -502,9 +502,11 @@ int main (int argc, char **argv)
goto fail2; goto fail2;
} }
char *path = "/data/data/com.github.shadowsocks/sock_path";
unlink(path);
memset(&addr, 0, sizeof(addr)); memset(&addr, 0, sizeof(addr));
addr.sun_family = AF_UNIX; 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) { if (bind(sock, (struct sockaddr*)&addr, sizeof(addr)) == -1) {
BLog(BLOG_ERROR, "bind() failed: %s (sock = %d)\n", strerror(errno), sock); BLog(BLOG_ERROR, "bind() failed: %s (sock = %d)\n", strerror(errno), sock);
......
...@@ -336,7 +336,7 @@ class ShadowsocksVpnService extends VpnService with BaseService { ...@@ -336,7 +336,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
if (BuildConfig.DEBUG) Log.d(TAG, cmd) if (BuildConfig.DEBUG) Log.d(TAG, cmd)
Console.runCommand(cmd.mkString(" ")) Console.runCommand(cmd)
return fd; return fd;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment