From f5f74bed3d73813a2b1ddffa5c58e463060cf602 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Mon, 11 Apr 2011 22:19:01 +0000 Subject: [PATCH] Use ws_open(), not open(), so we handle UTF-8 pathnames on Windows. Update or remove some additional "we don't have ferror() in zlib" comments to reflect the current reality. svn path=/trunk/; revision=36568 --- wiretap/airopeek9.c | 3 --- wiretap/cosine.c | 5 +---- wiretap/dbs-etherwatch.c | 3 +-- wiretap/eyesdn.c | 4 +--- wiretap/file_wrappers.c | 2 +- wiretap/iseries.c | 4 ++-- wiretap/netscreen.c | 5 +---- wiretap/toshiba.c | 3 +-- 8 files changed, 8 insertions(+), 21 deletions(-) diff --git a/wiretap/airopeek9.c b/wiretap/airopeek9.c index d0cd533c51..cea053c077 100644 --- a/wiretap/airopeek9.c +++ b/wiretap/airopeek9.c @@ -107,9 +107,6 @@ static int wtap_file_read_pattern (wtap *wth, const char *pattern, int *err) if (file_eof(wth->fh)) return 0; /* EOF */ else { - /* We (presumably) got an error (there's no equivalent to - "ferror()" in zlib, alas, so we don't have a wrapper - to check for an error). */ *err = file_error(wth->fh); return -1; /* error */ } diff --git a/wiretap/cosine.c b/wiretap/cosine.c index 42e11d384d..7ffeca88a8 100644 --- a/wiretap/cosine.c +++ b/wiretap/cosine.c @@ -226,10 +226,7 @@ static gint64 cosine_seek_next_packet(wtap *wth, int *err, char *hdr) /* We got an EOF. */ *err = 0; } else { - /* We (presumably) got an error (there's no - equivalent to "ferror()" in zlib, alas, - so we don't have a wrapper to check for - an error). */ + /* We got an error. */ *err = file_error(wth->fh); } break; diff --git a/wiretap/dbs-etherwatch.c b/wiretap/dbs-etherwatch.c index d46a2547bd..b6d6b14bad 100644 --- a/wiretap/dbs-etherwatch.c +++ b/wiretap/dbs-etherwatch.c @@ -128,8 +128,7 @@ static gint64 dbs_etherwatch_seek_next_packet(wtap *wth, int *err) /* We got an EOF. */ *err = 0; } else { - /* We (presumably) got an error (there's no equivalent to "ferror()" - in zlib, alas, so we don't have a wrapper to check for an error). */ + /* We got an error. */ *err = file_error(wth->fh); } return -1; diff --git a/wiretap/eyesdn.c b/wiretap/eyesdn.c index 19bb6ee813..4f5446761e 100644 --- a/wiretap/eyesdn.c +++ b/wiretap/eyesdn.c @@ -126,9 +126,7 @@ static gint64 eyesdn_seek_next_packet(wtap *wth, int *err) /* We got an EOF. */ *err = 0; } else { - /* We (presumably) got an error (there's no equivalent to - "ferror()" in zlib, alas, so we don't have a wrapper to - check for an error). */ + /* We got an error. */ *err = file_error(wth->fh); } return -1; diff --git a/wiretap/file_wrappers.c b/wiretap/file_wrappers.c index e3e935d7db..713142e0ae 100644 --- a/wiretap/file_wrappers.c +++ b/wiretap/file_wrappers.c @@ -780,7 +780,7 @@ gzwfile_open(const char *path) GZWFILE_T state; int save_errno; - fd = open(path, O_BINARY|O_WRONLY|O_CREAT|O_TRUNC, 0666); + fd = ws_open(path, O_BINARY|O_WRONLY|O_CREAT|O_TRUNC, 0666); if (fd == -1) return NULL; state = gzwfile_fdopen(fd); diff --git a/wiretap/iseries.c b/wiretap/iseries.c index 47a02f3969..c92fe1b562 100644 --- a/wiretap/iseries.c +++ b/wiretap/iseries.c @@ -427,12 +427,12 @@ iseries_seek_next_packet (wtap * wth, int *err) { if (file_eof (wth->fh)) { + /* We got an EOF. */ *err = 0; } else { - /* We (presumably) got an error (there's no equivalent to "ferror()" - in zlib, alas, so we don't have a wrapper to check for an error). */ + /* We got an error. */ *err = file_error (wth->fh); } return -1; diff --git a/wiretap/netscreen.c b/wiretap/netscreen.c index 9c652dc4f4..0a8fef4be0 100644 --- a/wiretap/netscreen.c +++ b/wiretap/netscreen.c @@ -135,10 +135,7 @@ static gint64 netscreen_seek_next_packet(wtap *wth, int *err, char *hdr) /* We got an EOF. */ *err = 0; } else { - /* We (presumably) got an error (there's no - equivalent to "ferror()" in zlib, alas, - so we don't have a wrapper to check for - an error). */ + /* We got an error. */ *err = file_error(wth->fh); } break; diff --git a/wiretap/toshiba.c b/wiretap/toshiba.c index d95c689544..bfaf304bbb 100644 --- a/wiretap/toshiba.c +++ b/wiretap/toshiba.c @@ -150,8 +150,7 @@ static gint64 toshiba_seek_next_packet(wtap *wth, int *err) /* We got an EOF. */ *err = 0; } else { - /* We (presumably) got an error (there's no equivalent to "ferror()" - in zlib, alas, so we don't have a wrapper to check for an error). */ + /* We got an error. */ *err = file_error(wth->fh); } return -1;