Cleanup obsolete code

Refs #431
This commit is contained in:
M66B 2016-06-24 16:28:50 +02:00
parent 810a7ca23c
commit b1de77be1e
3 changed files with 1 additions and 21 deletions

View File

@ -413,8 +413,6 @@ int open_tcp_socket(const struct arguments *args,
int32_t get_local_port(const int sock);
int is_valid_fd(const int fd);
int write_syn_ack(const struct arguments *args, struct tcp_session *cur);
int write_ack(const struct arguments *args, struct tcp_session *cur);

View File

@ -126,7 +126,7 @@ void *handle_events(void *a) {
while (!stopping) {
log_android(ANDROID_LOG_DEBUG, "Loop thread %x", thread_id);
// Count/check sessions
// Count sessions
int isessions = 0;
int usessions = 0;
int tsessions = 0;
@ -208,20 +208,6 @@ void *handle_events(void *a) {
"epoll interrupted tun %d thread %x", args->tun, thread_id);
continue;
}
} else if (errno == EBADF) {
if (is_valid_fd(args->tun)) {
log_android(ANDROID_LOG_ERROR, "epoll error %d: %s", errno, strerror(errno));
report_exit(args, "epoll error %d: %s", errno, strerror(errno));
break;
}
else {
log_android(ANDROID_LOG_ERROR,
"tun socket %d epoll error %d: %s",
args->tun, errno, strerror(errno));
report_exit(args, "tun socket %d epoll error %d: %s",
args->tun, errno, strerror(errno));
break;
}
} else {
log_android(ANDROID_LOG_ERROR,
"epoll tun %d thread %x error %d: %s",

View File

@ -152,7 +152,3 @@ int32_t get_local_port(const int sock) {
return ntohs(sin.sin_port);
}
int is_valid_fd(const int fd) {
return fcntl(fd, F_GETFL) != -1 || errno != EBADF;
}