aboutsummaryrefslogtreecommitdiffstats
path: root/capture.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>1999-09-30 06:11:51 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>1999-09-30 06:11:51 +0000
commit00a908da798e235c4b6c9ef100dac5daa5365620 (patch)
treeb548d7d18bcd1861e41f94e36c6a8cf6dac51e50 /capture.c
parentdb37b36d2ba390e60d5c02f238684206e615a6ba (diff)
If we're given the "-k" flag, don't start the capture until after we've:
popped up the top-level window (so that it looks like a capture started from "Capture/Start"); initialized the colors (so that we don't dump core when reading in the capture file); popped up any message box for failure to read the preferences file. This means we start the capture in "main()", rather than in the realize callback for the main window, so get rid of that callback. If we're a child process that's just capturing to a file for our parent to read, however, we shouldn't pop up the top-level window, because that's our parent's job; when running that child, set its "argv[0]" to a special name, so that 1) it shows up in a "ps" with a special name; 2) we don't have to invent Yet Another Flag to say "you're the child". (We may want to use the name to turn on *all* behaviors that the capture child, and only the capture child, should exhibit.) If "-w" and "-k" were both specified, attempt to open the file specified by "-w" and, if that succeeds, set "cf.save_file_fd" to refer to it, so that "-w" plus "-k" works again, rather than popping up a "The file to which the capture would be saved ... could not be opened: Bad file descriptor." message box. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@739 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'capture.c')
-rw-r--r--capture.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/capture.c b/capture.c
index f2631efed3..2d22b54474 100644
--- a/capture.c
+++ b/capture.c
@@ -1,7 +1,7 @@
/* capture.c
* Routines for packet capture windows
*
- * $Id: capture.c,v 1.72 1999/09/25 02:02:11 guy Exp $
+ * $Id: capture.c,v 1.73 1999/09/30 06:11:43 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -153,7 +153,7 @@ do_capture(void)
close(1);
dup(sync_pipe[1]);
close(sync_pipe[0]);
- execlp(ethereal_path, "ethereal", "-k", "-Q", "-i", cf.iface,
+ execlp(ethereal_path, CHILD_NAME, "-k", "-Q", "-i", cf.iface,
"-w", cf.save_file, "-W", save_file_fd,
"-c", scount, "-s", ssnap, "-S",
"-m", medium_font, "-b", bold_font,
@@ -162,7 +162,7 @@ do_capture(void)
(const char *)NULL);
}
else {
- execlp(ethereal_path, "ethereal", "-k", "-Q", "-i", cf.iface,
+ execlp(ethereal_path, CHILD_NAME, "-k", "-Q", "-i", cf.iface,
"-w", cf.save_file, "-W", save_file_fd,
"-c", scount, "-s", ssnap,
"-m", medium_font, "-b", bold_font,