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
This commit is contained in:
Guy Harris 2011-04-11 22:19:01 +00:00
parent 35c66a1745
commit f5f74bed3d
8 changed files with 8 additions and 21 deletions

View File

@ -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 */
}

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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;