From 0d64f11f47366a23397c96447ae1e22ead1781bb Mon Sep 17 00:00:00 2001 From: Max Lv Date: Sun, 24 Jan 2016 17:18:09 +0800 Subject: [PATCH] Fix typo --- src/android.c | 8 +++++--- src/local.c | 2 +- src/tunnel.c | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/android.c b/src/android.c index 0630970b..f16aadff 100644 --- a/src/android.c +++ b/src/android.c @@ -72,7 +72,8 @@ int protect_socket(int fd) strncpy(addr.sun_path, path, sizeof(addr.sun_path) - 1); if (connect(sock, (struct sockaddr *)&addr, sizeof(addr)) == -1) { - LOGE("[android] connect() failed: %s (socket fd = %d)\n", strerror(errno), sock); + LOGE("[android] connect() failed: %s (socket fd = %d), path: %s\n", + strerror(errno), sock, path); close(sock); return -1; } @@ -113,14 +114,15 @@ int send_traffic_stat(uint64_t tx, uint64_t rx) setsockopt(sock, SOL_SOCKET, SO_SNDTIMEO, (char *)&tv, sizeof(struct timeval)); char path[256]; - sprintf(path, "%s/protect_path", prefix); + sprintf(path, "%s/stat_path", prefix); memset(&addr, 0, sizeof(addr)); addr.sun_family = AF_UNIX; strncpy(addr.sun_path, path, sizeof(addr.sun_path) - 1); if (connect(sock, (struct sockaddr *)&addr, sizeof(addr)) == -1) { - LOGE("[android] connect() failed: %s (socket fd = %d)\n", strerror(errno), sock); + LOGE("[android] connect() failed: %s (socket fd = %d), path: %s\n", + strerror(errno), sock, path); close(sock); return -1; } diff --git a/src/local.c b/src/local.c index 86c11649..dd59738c 100644 --- a/src/local.c +++ b/src/local.c @@ -995,7 +995,7 @@ int main(int argc, char **argv) USE_TTY(); #ifdef ANDROID - while ((c = getopt_long(argc, argv, "f:s:p:l:k:t:m:i:c:b:a:n:uvVAP", + while ((c = getopt_long(argc, argv, "f:s:p:l:k:t:m:i:c:b:a:n:P:uvVA", long_options, &option_index)) != -1) { #else while ((c = getopt_long(argc, argv, "f:s:p:l:k:t:m:i:c:b:a:n:uvA", diff --git a/src/tunnel.c b/src/tunnel.c index 7e7e08b5..f581e096 100644 --- a/src/tunnel.c +++ b/src/tunnel.c @@ -701,7 +701,7 @@ int main(int argc, char **argv) USE_TTY(); #ifdef ANDROID - while ((c = getopt(argc, argv, "f:s:p:l:k:t:m:i:c:b:L:a:n:uUvVAP")) != -1) { + while ((c = getopt(argc, argv, "f:s:p:l:k:t:m:i:c:b:L:a:n:P:uUvVA")) != -1) { #else while ((c = getopt(argc, argv, "f:s:p:l:k:t:m:i:c:b:L:a:n:uUvA")) != -1) { #endif