diff options
author | Guy Harris <guy@alum.mit.edu> | 1999-08-18 17:49:34 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 1999-08-18 17:49:34 +0000 |
commit | 0f62ffc5df6ebe3fa74aad7e273f6089376bfbbb (patch) | |
tree | 69449124763263faf70e219bba0762272145d7e3 /wiretap/file.c | |
parent | 31d104a9c57daa6601ba1bb99594e679e96333cd (diff) | |
download | wireshark-0f62ffc5df6ebe3fa74aad7e273f6089376bfbbb.tar.gz wireshark-0f62ffc5df6ebe3fa74aad7e273f6089376bfbbb.tar.bz2 wireshark-0f62ffc5df6ebe3fa74aad7e273f6089376bfbbb.zip |
In "wtap_dump_close()", don't shove the return value of "fclose()" into
the variable for the return value of "wtap_dump_close()", just check it
against EOF; shoving it into "ret" means it gets set to 0 on a
successful close, but a return value of 0 means "wtap_dump_close()"
failed.
svn path=/trunk/; revision=514
Diffstat (limited to 'wiretap/file.c')
-rw-r--r-- | wiretap/file.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/wiretap/file.c b/wiretap/file.c index 67106b2d96..cc53ea37ff 100644 --- a/wiretap/file.c +++ b/wiretap/file.c @@ -1,6 +1,6 @@ /* file.c * - * $Id: file.c,v 1.15 1999/08/18 04:41:19 guy Exp $ + * $Id: file.c,v 1.16 1999/08/18 17:49:34 guy Exp $ * * Wiretap Library * Copyright (c) 1998 by Gilbert Ramirez <gram@verdict.uthscsa.edu> @@ -219,8 +219,7 @@ int wtap_dump_close(wtap_dumper *wdh, int *err) if (!(wdh->subtype_close)(wdh, err)) ret = 0; errno = WTAP_ERR_CANT_CLOSE; - ret = fclose(wdh->fh); - if (ret == EOF) { + if (fclose(wdh->fh) == EOF) { if (ret) { /* The per-format close function succeeded, but the fclose didn't. Save the reason |