summaryrefslogtreecommitdiff
path: root/extcap/androiddump.c
diff options
context:
space:
mode:
Diffstat (limited to 'extcap/androiddump.c')
-rw-r--r--extcap/androiddump.c69
1 files changed, 60 insertions, 9 deletions
diff --git a/extcap/androiddump.c b/extcap/androiddump.c
index e03d93495e..07a2f77ad8 100644
--- a/extcap/androiddump.c
+++ b/extcap/androiddump.c
@@ -1159,7 +1159,13 @@ static int capture_android_bluetooth_hcidump(char *interface, char *fifo,
errno = 0;
length = recv(sock, data + used_buffer_length, (int)(PACKET_LENGTH - used_buffer_length), 0);
- if (errno == EAGAIN || (EWOULDBLOCK != EAGAIN && errno == EWOULDBLOCK)) continue;
+ if (errno == EAGAIN
+#if EWOULDBLOCK != EAGAIN
+ || errno == EWOULDBLOCK
+#endif
+ ) {
+ continue;
+ }
else if (errno != 0) {
errmsg_print("ERROR capture: %s", strerror(errno));
closesocket(sock);
@@ -1231,7 +1237,13 @@ static int capture_android_bluetooth_hcidump(char *interface, char *fifo,
errno = 0;
length = recv(sock, data + used_buffer_length, (int)(PACKET_LENGTH - used_buffer_length), 0);
- if (errno == EAGAIN || (EWOULDBLOCK != EAGAIN && errno == EWOULDBLOCK)) continue;
+ if (errno == EAGAIN
+#if EWOULDBLOCK != EAGAIN
+ || errno == EWOULDBLOCK
+#endif
+ ) {
+ continue;
+ }
else if (errno != 0) {
errmsg_print("ERROR capture: %s", strerror(errno));
closesocket(sock);
@@ -1267,7 +1279,13 @@ static int capture_android_bluetooth_hcidump(char *interface, char *fifo,
while (endless_loop) {
errno = 0;
length = recv(sock, data + used_buffer_length, (int)(PACKET_LENGTH - used_buffer_length), 0);
- if (errno == EAGAIN || (EWOULDBLOCK != EAGAIN && errno == EWOULDBLOCK)) continue;
+ if (errno == EAGAIN
+#if EWOULDBLOCK != EAGAIN
+ || errno == EWOULDBLOCK
+#endif
+ ) {
+ continue;
+ }
else if (errno != 0) {
errmsg_print("ERROR capture: %s", strerror(errno));
closesocket(sock);
@@ -1581,7 +1599,13 @@ static int capture_android_bluetooth_external_parser(char *interface,
while (endless_loop) {
errno = 0;
length = recv(sock, buffer + used_buffer_length, (int)(PACKET_LENGTH - used_buffer_length), 0);
- if (errno == EAGAIN || (EWOULDBLOCK != EAGAIN && errno == EWOULDBLOCK)) continue;
+ if (errno == EAGAIN
+#if EWOULDBLOCK != EAGAIN
+ || errno == EWOULDBLOCK
+#endif
+ ) {
+ continue;
+ }
else if (errno != 0) {
errmsg_print("ERROR capture: %s", strerror(errno));
closesocket(sock);
@@ -1802,7 +1826,13 @@ static int capture_android_bluetooth_btsnoop_net(char *interface, char *fifo,
errno = 0;
length = recv(sock, packet + used_buffer_length + sizeof(own_pcap_bluetooth_h4_header),
(int)(PACKET_LENGTH - sizeof(own_pcap_bluetooth_h4_header) - used_buffer_length), 0);
- if (errno == EAGAIN || (EWOULDBLOCK != EAGAIN && errno == EWOULDBLOCK)) continue;
+ if (errno == EAGAIN
+#if EWOULDBLOCK != EAGAIN
+ || errno == EWOULDBLOCK
+#endif
+ ) {
+ continue;
+ }
else if (errno != 0) {
errmsg_print("ERROR capture: %s", strerror(errno));
closesocket(sock);
@@ -1979,7 +2009,13 @@ static int capture_android_logcat_text(char *interface, char *fifo,
while (endless_loop) {
errno = 0;
length = recv(sock, packet + exported_pdu_headers_size + used_buffer_length, (int)(PACKET_LENGTH - exported_pdu_headers_size - used_buffer_length), 0);
- if (errno == EAGAIN || (EWOULDBLOCK != EAGAIN && errno == EWOULDBLOCK)) continue;
+ if (errno == EAGAIN
+#if EWOULDBLOCK != EAGAIN
+ || errno == EWOULDBLOCK
+#endif
+ ) {
+ continue;
+ }
else if (errno != 0) {
errmsg_print("ERROR capture: %s", strerror(errno));
closesocket(sock);
@@ -2159,7 +2195,13 @@ static int capture_android_logcat(char *interface, char *fifo,
while (endless_loop) {
errno = 0;
length = recv(sock, packet + exported_pdu_headers_size + used_buffer_length, (int)(PACKET_LENGTH - exported_pdu_headers_size - used_buffer_length), 0);
- if (errno == EAGAIN || (EWOULDBLOCK != EAGAIN && errno == EWOULDBLOCK)) continue;
+ if (errno == EAGAIN
+#if EWOULDBLOCK != EAGAIN
+ || errno == EWOULDBLOCK
+#endif
+ ) {
+ continue;
+ }
else if (errno != 0) {
errmsg_print("ERROR capture: %s", strerror(errno));
closesocket(sock);
@@ -2331,8 +2373,13 @@ static int capture_android_wifi_tcpdump(char *interface, char *fifo,
char *i_position;
errno = 0;
length = recv(sock, data + used_buffer_length, (int)(PACKET_LENGTH - used_buffer_length), 0);
- if (errno == EAGAIN || (EWOULDBLOCK != EAGAIN && errno == EWOULDBLOCK))
+ if (errno == EAGAIN
+#if EWOULDBLOCK != EAGAIN
+ || errno == EWOULDBLOCK
+#endif
+ ) {
continue;
+ }
else if (errno != 0) {
errmsg_print("ERROR capture: %s", strerror(errno));
return EXIT_CODE_GENERIC;
@@ -2449,7 +2496,11 @@ static int capture_android_wifi_tcpdump(char *interface, char *fifo,
while (endless_loop) {
errno = 0;
length = recv(sock, data + used_buffer_length, (int)(PACKET_LENGTH -(used_buffer_length + filter_buffer_length)), 0);
- if (errno == EAGAIN || (EWOULDBLOCK != EAGAIN && errno == EWOULDBLOCK)) {
+ if (errno == EAGAIN
+#if EWOULDBLOCK != EAGAIN
+ || errno == EWOULDBLOCK
+#endif
+ ) {
continue;
}
else if (errno != 0) {