diff options
author | Guy Harris <guy@alum.mit.edu> | 1999-10-02 06:00:07 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 1999-10-02 06:00:07 +0000 |
commit | b34d0437c9ffa0aa38c8620fb703c28266c6b865 (patch) | |
tree | 61c6f54c874430931d2547fc9f9638d3786427bd /gtk | |
parent | 60f385ac019e440d7892bd83c7ecfe6787d6b02a (diff) |
A child process for a "-S" or "-F" capture should *always* exit when the
capture is done; make it do so, and don't bother passing it a "-Q" flag
to tell it to do so.
"capture()" is called in two places; in one place, it's in a child
process, and it shouldn't read in the capture file. Move the reading of
the capture file out of "capture()" itself to the place where we
*should* read in the capture file after it returns. Also, have it
return an indication of whether it succeeded or failed, so we know
whether we should read in the capture file.
svn path=/trunk/; revision=747
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/main.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/gtk/main.c b/gtk/main.c index 4ba85d1885..41a0cc488f 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -1,6 +1,6 @@ /* main.c * - * $Id: main.c,v 1.13 1999/10/01 21:52:03 guy Exp $ + * $Id: main.c,v 1.14 1999/10/02 05:59:58 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -658,16 +658,17 @@ main(int argc, char *argv[]) fprintf(stderr, "ethereal: \"-k\" flag was specified without \"-w\" flag\n"); exit(1); } + } #ifdef HAVE_LIBPCAP - if (capture_child && (sync_mode || fork_mode)) { - if (cf.save_file_fd == -1) { - fprintf(stderr, "ethereal: \"-k\" flag was specified with \"-%c\" flag but without \"-W\" flag\n", - (sync_mode ? 'S' : 'F')); - exit(1); - } + if (capture_child) { + if (cf.save_file_fd == -1) { + /* XXX - send this to the standard output as something our parent + should put in an error message box? */ + fprintf(stderr, "%s: \"-W\" flag not specified\n", CHILD_NAME); + exit(1); } -#endif } +#endif /* Build the column format array */ for (i = 0; i < cf.cinfo.num_cols; i++) { @@ -914,6 +915,9 @@ main(int argc, char *argv[]) fork off *another* child process (so don't call "run_capture()"). */ capture(); + + /* The capture is done; there's nothing more for us to do. */ + gtk_exit(0); } else { if (start_capture) { /* "-k" was specified; start a capture. */ |