diff options
author | Ashok Narayanan <ashokn@cisco.com> | 1999-09-23 04:39:01 +0000 |
---|---|---|
committer | Ashok Narayanan <ashokn@cisco.com> | 1999-09-23 04:39:01 +0000 |
commit | 501b9b05e19391fba0e33751b41bb6a47063491a (patch) | |
tree | 5c1982f3297f1cf679f2cbb229df4b37f895a1da /wiretap/file.c | |
parent | 5953b86866ee16efb2badc9603080e90fa9f86d6 (diff) |
Adds progress bar functionality back for loading files (it was changed to
bounce bar for compressed file support). Note that the progress bar may
not grow smoothly for compressed files, but it should be reasonably accurate
for files which are large enough to matter.
svn path=/trunk/; revision=701
Diffstat (limited to 'wiretap/file.c')
-rw-r--r-- | wiretap/file.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/wiretap/file.c b/wiretap/file.c index 128e1fe413..a10472984d 100644 --- a/wiretap/file.c +++ b/wiretap/file.c @@ -1,6 +1,6 @@ /* file.c * - * $Id: file.c,v 1.21 1999/09/22 01:26:46 ashokn Exp $ + * $Id: file.c,v 1.22 1999/09/23 04:39:00 ashokn Exp $ * * Wiretap Library * Copyright (c) 1998 by Gilbert Ramirez <gram@verdict.uthscsa.edu> @@ -24,6 +24,7 @@ #include "config.h" #endif #include <stdio.h> +#include <fcntl.h> #include <string.h> #include <stdlib.h> #include <sys/stat.h> @@ -106,7 +107,12 @@ wtap* wtap_open_offline(const char *filename, int *err) /* Open the file */ errno = WTAP_ERR_CANT_OPEN; - if (!(wth->fh = file_open(filename, "rb"))) { + if (!(wth->fd = open(filename, O_RDONLY))) { + *err = errno; + free(wth); + return NULL; + } + if (!(wth->fh = filed_open(wth->fd, "rb"))) { *err = errno; free(wth); return NULL; @@ -124,6 +130,7 @@ wtap* wtap_open_offline(const char *filename, int *err) /* I/O error - give up */ *err = errno; file_close(wth->fh); + close(wth->fd); free(wth); return NULL; |