aboutsummaryrefslogtreecommitdiffstats
path: root/rawshark.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2015-11-08 02:31:01 -0800
committerGuy Harris <guy@alum.mit.edu>2015-11-08 10:32:09 +0000
commitcaa1e87410fb74606f2ec91b5fd1b897053149bf (patch)
tree7d46afa570a24957716f5b74add64760bfeb5079 /rawshark.c
parent11bdadacc27d3781c3fd0d759068fddd3da9107c (diff)
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 <guy@alum.mit.edu>
Diffstat (limited to 'rawshark.c')
-rw-r--r--rawshark.c6
1 files changed, 3 insertions, 3 deletions
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;