aboutsummaryrefslogtreecommitdiffstats
path: root/dumpcap.c
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2017-12-04 21:57:08 +0100
committerAnders Broman <a.broman58@gmail.com>2017-12-05 04:52:40 +0000
commit9b7dd3ca2045ad1187311197abe003161c816b5c (patch)
treea569feea450d369cc3981c8e7372848a2aaa8d90 /dumpcap.c
parenta7603a1f684f0ae5a2084530d44e37f29ee9e41f (diff)
dumpcap.c: cap_pipe_read() returns a ssize_t whatever the platform (CID 1424899)
Change-Id: I9c157e1ed7264d787c26ca60bbbe32edfc99bff8 Reviewed-on: https://code.wireshark.org/review/24706 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'dumpcap.c')
-rw-r--r--dumpcap.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/dumpcap.c b/dumpcap.c
index 458e576e5c..19287b9fe7 100644
--- a/dumpcap.c
+++ b/dumpcap.c
@@ -1284,11 +1284,11 @@ static void *cap_thread_read(void *arg)
capture_src *pcap_src;
#ifdef _WIN32
BOOL res;
- DWORD b, last_err, bytes_read;
+ DWORD last_err, bytes_read;
#else /* _WIN32 */
size_t bytes_read;
- int b;
#endif /* _WIN32 */
+ ssize_t b;
pcap_src = (capture_src *)arg;
while (pcap_src->cap_pipe_err == PIPOK) {
@@ -1481,10 +1481,12 @@ cap_pipe_read_data_bytes(capture_src *pcap_src, char *errmsg, int errmsgl)
int sel_ret;
int fd = pcap_src->cap_pipe_fd;
#ifdef _WIN32
- DWORD b, sz, bytes_read = 0;
+ DWORD sz, bytes_read = 0;
#else /* _WIN32 */
- size_t b, sz, bytes_read = 0;
+ size_t sz, bytes_read = 0;
#endif /* _WIN32 */
+ ssize_t b;
+
sz = pcap_src->cap_pipe_bytes_to_read - pcap_src->cap_pipe_bytes_read;
while (bytes_read < sz) {
if (fd == -1) {