Browse Source

Fix typo

pull/542/head
Max Lv 8 years ago
parent
commit
0d64f11f47
3 changed files with 7 additions and 5 deletions
  1. 8
      src/android.c
  2. 2
      src/local.c
  3. 2
      src/tunnel.c

8
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;
}

2
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",

2
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

Loading…
Cancel
Save