diff options
author | Dario Lombardo <lomato@gmail.com> | 2016-11-17 11:33:02 +0100 |
---|---|---|
committer | Michal Labedzki <michal.labedzki@tieto.com> | 2016-11-18 09:26:41 +0000 |
commit | 6a91e8aba70336284ad3dc09d46ecd9421799ab6 (patch) | |
tree | 4d38d7d62bbc54a59d979b2d20751186cfdfbded | |
parent | a90d196ce8f8dee4beb22c508080dfef6efdf71b (diff) |
androiddump: check return value in useSndTimeout() (CID 1394378).
Change-Id: I14109ffe1b9930c464ce2c42767f96b8ba4e5b67
Reviewed-on: https://code.wireshark.org/review/18855
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
-rw-r--r-- | extcap/androiddump.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/extcap/androiddump.c b/extcap/androiddump.c index 70e9a86a02..89dd6ec9f2 100644 --- a/extcap/androiddump.c +++ b/extcap/androiddump.c @@ -250,18 +250,21 @@ static inline int is_specified_interface(char *interface, const char *interface_ } static void useSndTimeout(socket_handle_t sock) { + int res; #ifdef _WIN32 const DWORD socket_timeout = SOCKET_SEND_TIMEOUT_MS; - setsockopt(sock, SOL_SOCKET, SO_SNDTIMEO, (const char *) &socket_timeout, sizeof(socket_timeout)); + res = setsockopt(sock, SOL_SOCKET, SO_SNDTIMEO, (const char *) &socket_timeout, sizeof(socket_timeout)); #else const struct timeval socket_timeout = { .tv_sec = SOCKET_SEND_TIMEOUT_MS / 1000, .tv_usec = (SOCKET_SEND_TIMEOUT_MS % 1000) * 1000 }; - setsockopt(sock, SOL_SOCKET, SO_SNDTIMEO, &socket_timeout, sizeof(socket_timeout)); + res = setsockopt(sock, SOL_SOCKET, SO_SNDTIMEO, &socket_timeout, sizeof(socket_timeout)); #endif + if (res != 0) + g_debug("Can't set socket timeout, using default"); } static struct extcap_dumper extcap_dumper_open(char *fifo, int encap) { |