From caa1e87410fb74606f2ec91b5fd1b897053149bf Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Sun, 8 Nov 2015 02:31:01 -0800 Subject: Use ws_{read,write,fdopen,close}. Be more consistent about using the ws_ routines, as we suggest in README.developer. In C++ on UN*X, define ws_close as ::close rather than close, so that it works even in classes with methods or members named "close". Change-Id: Ide2652229e6b6b4624cbddae0e909a4ea1efa591 Reviewed-on: https://code.wireshark.org/review/11637 Reviewed-by: Guy Harris --- rawshark.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'rawshark.c') diff --git a/rawshark.c b/rawshark.c index 78e3e83448..1becd58a04 100644 --- a/rawshark.c +++ b/rawshark.c @@ -830,7 +830,7 @@ DIAG_ON(cast-qual) size_t bytes_left = sizeof(struct pcap_hdr) + sizeof(guint32); gchar buf[sizeof(struct pcap_hdr) + sizeof(guint32)]; while (bytes_left != 0) { - ssize_t bytes = read(fd, buf, (int)bytes_left); + ssize_t bytes = ws_read(fd, buf, (int)bytes_left); if (bytes <= 0) { cmdarg_err("Not enough bytes for pcap header."); exit(2); @@ -883,7 +883,7 @@ raw_pipe_read(struct wtap_pkthdr *phdr, guchar * pd, int *err, gchar **err_info, /* Copied from capture_loop.c */ while (bytes_needed > 0) { - bytes_read = read(fd, ptr, (int)bytes_needed); + bytes_read = ws_read(fd, ptr, (int)bytes_needed); if (bytes_read == 0) { *err = 0; *err_info = NULL; @@ -929,7 +929,7 @@ raw_pipe_read(struct wtap_pkthdr *phdr, guchar * pd, int *err, gchar **err_info, ptr = pd; while (bytes_needed > 0) { - bytes_read = read(fd, ptr, (int)bytes_needed); + bytes_read = ws_read(fd, ptr, (int)bytes_needed); if (bytes_read == 0) { *err = WTAP_ERR_SHORT_READ; *err_info = NULL; -- cgit v1.2.3