diff options
author | Stefan Metzmacher <metze@samba.org> | 2020-06-19 23:26:22 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2020-06-19 23:26:22 +0200 |
commit | f13db2b166dd9cc0ee31b5cdffdacb34945d615a (patch) | |
tree | 1cde90da57df98066efd7b6ad16778df8cd52861 | |
parent | 22cfac3bfca20eedbd0e3e428f085b24fb553047 (diff) | |
download | socket_wrapper-f13db2b166dd9cc0ee31b5cdffdacb34945d615a.tar.gz socket_wrapper-f13db2b166dd9cc0ee31b5cdffdacb34945d615a.tar.xz socket_wrapper-f13db2b166dd9cc0ee31b5cdffdacb34945d615a.zip |
Revert "socket_wrapper.c: make FIONREAD handling more robust in swrap_vioctl()"
This reverts commit c95b7cb1d7b9348472276edceff71889aa676d25.
This got merged automatically by gitlab without review.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
-rw-r--r-- | src/socket_wrapper.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/socket_wrapper.c b/src/socket_wrapper.c index e7a7a8a..4fb7b23 100644 --- a/src/socket_wrapper.c +++ b/src/socket_wrapper.c @@ -4635,7 +4635,7 @@ static int swrap_vioctl(int s, unsigned long int r, va_list va) { struct socket_info *si = find_socket_info(s); va_list ap; - int *value_ptr = NULL; + int value; int rc; if (!si) { @@ -4650,13 +4650,11 @@ static int swrap_vioctl(int s, unsigned long int r, va_list va) switch (r) { case FIONREAD: - if (rc == 0) { - value_ptr = ((int *)va_arg(ap, int *)); - } + value = *((int *)va_arg(ap, int *)); if (rc == -1 && errno != EAGAIN && errno != ENOBUFS) { swrap_pcap_dump_packet(si, NULL, SWRAP_PENDING_RST, NULL, 0); - } else if (value_ptr != NULL && *value_ptr == 0) { /* END OF FILE */ + } else if (value == 0) { /* END OF FILE */ swrap_pcap_dump_packet(si, NULL, SWRAP_PENDING_RST, NULL, 0); } break; |