aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/visual.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2002-07-16 07:15:09 +0000
committerGuy Harris <guy@alum.mit.edu>2002-07-16 07:15:09 +0000
commit44d19627efccd1b7461d38a6ba6eb25a98ed66ac (patch)
tree9a9121589e31a5c3981ca9d943da7f385c731afd /wiretap/visual.c
parent41dc7b1b59bef7521b9e6febc7a482e2f32017fe (diff)
downloadwireshark-44d19627efccd1b7461d38a6ba6eb25a98ed66ac.tar.gz
wireshark-44d19627efccd1b7461d38a6ba6eb25a98ed66ac.tar.bz2
wireshark-44d19627efccd1b7461d38a6ba6eb25a98ed66ac.zip
From Graeme Hewson:
Allow "-" as the output file name in Wiretap, referring to the standard error. Optimize the capture loop. Fix some of the error-message printing code in Ethereal and Tethereal. Have Wiretap check whether it can seek on a file descriptor, and pass the results of that test to the file-type-specific "open for output" routine. Have the "open for output" routines for files where we need to seek when writing the file return an error if seeks don't work. svn path=/trunk/; revision=5884
Diffstat (limited to 'wiretap/visual.c')
-rw-r--r--wiretap/visual.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/wiretap/visual.c b/wiretap/visual.c
index 41dca79594..b1d4efbf03 100644
--- a/wiretap/visual.c
+++ b/wiretap/visual.c
@@ -2,7 +2,7 @@
* File read and write routines for Visual Networks cap files.
* Copyright (c) 2001, Tom Nisbet tnisbet@visualnetworks.com
*
- * $Id: visual.c,v 1.8 2002/06/07 07:27:35 guy Exp $
+ * $Id: visual.c,v 1.9 2002/07/16 07:15:09 guy Exp $
*
* Wiretap Library
* Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
@@ -412,10 +412,17 @@ int visual_dump_can_write_encap(int encap)
/* Open a file for writing.
Returns TRUE on success, FALSE on failure; sets "*err" to an
error code on failure */
-gboolean visual_dump_open(wtap_dumper *wdh, int *err)
+gboolean visual_dump_open(wtap_dumper *wdh, gboolean cant_seek, int *err)
{
struct visual_write_info *visual;
+ /* We can't fill in some fields in the header until all the packets
+ have been written, so we can't write to a pipe. */
+ if (cant_seek) {
+ *err = WTAP_ERR_CANT_WRITE_TO_PIPE;
+ return FALSE;
+ }
+
/* Set the write routines for a visual file. */
wdh->subtype_write = visual_dump;
wdh->subtype_close = visual_dump_close;