diff options
author | Guy Harris <guy@alum.mit.edu> | 1999-09-23 07:20:20 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 1999-09-23 07:20:20 +0000 |
commit | b2b8994f151b17971fbc57c2b70fb02eecefbfe1 (patch) | |
tree | fb0528417e2af5d6f50cc475e7ff1e5a345a3c3c /gtk | |
parent | 3aa6164cbafd596a2c347b5d772a639c59f57dd0 (diff) |
If we forcibly turn off "fork_mode" if the user doesn't enable "Update
list of packets in real time" in the "Capture/Start" dialog box,
"ethereal -F" won't work - you get your choice of non-forked capture or
"-S".
Don't have "fork_mode" track "sync_mode"; instead, in those places where
we check for "fork_mode", check for "sync_mode" as well.
svn path=/trunk/; revision=711
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/capture_dlg.c | 4 | ||||
-rw-r--r-- | gtk/file_dlg.c | 6 | ||||
-rw-r--r-- | gtk/main.c | 11 |
3 files changed, 9 insertions, 12 deletions
diff --git a/gtk/capture_dlg.c b/gtk/capture_dlg.c index 6d4e1159e0..ed64d20a5b 100644 --- a/gtk/capture_dlg.c +++ b/gtk/capture_dlg.c @@ -1,7 +1,7 @@ /* capture_dlg.c * Routines for packet capture windows * - * $Id: capture_dlg.c,v 1.3 1999/09/23 06:27:27 guy Exp $ + * $Id: capture_dlg.c,v 1.4 1999/09/23 07:20:19 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -276,12 +276,10 @@ capture_prep_ok_cb(GtkWidget *ok_bt, gpointer parent_w) { /* They requested that the summary window be updated as packets are captured. */ sync_mode = TRUE; - fork_mode = TRUE; /* -S implies -F */ } else { /* They requested that the summary window not be updated as packets are captured. */ sync_mode = FALSE; - fork_mode = FALSE; } gtk_widget_destroy(GTK_WIDGET(parent_w)); diff --git a/gtk/file_dlg.c b/gtk/file_dlg.c index c7dbdf4ac4..72c3a9ab70 100644 --- a/gtk/file_dlg.c +++ b/gtk/file_dlg.c @@ -1,7 +1,7 @@ /* file_dlg.c * Dialog boxes for handling files * - * $Id: file_dlg.c,v 1.3 1999/09/09 04:25:49 guy Exp $ + * $Id: file_dlg.c,v 1.4 1999/09/23 07:20:20 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -105,9 +105,9 @@ file_open_cmd_cb(GtkWidget *w, gpointer data) { gtk_widget_destroy, GTK_OBJECT (file_sel)); #ifdef HAVE_LIBPCAP - if( fork_mode && (cf.save_file != NULL) ) + if ((sync_mode || fork_mode) && (cf.save_file != NULL)) #else - if( cf.save_file != NULL ) + if (cf.save_file != NULL) #endif gtk_file_selection_set_filename(GTK_FILE_SELECTION(file_sel), cf.save_file); else diff --git a/gtk/main.c b/gtk/main.c index 3c1405c36f..d3314be5be 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -1,6 +1,6 @@ /* main.c * - * $Id: main.c,v 1.7 1999/09/23 06:27:27 guy Exp $ + * $Id: main.c,v 1.8 1999/09/23 07:20:20 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -115,7 +115,7 @@ ts_type timestamp_type = RELATIVE; GtkStyle *item_style; #ifdef HAVE_LIBPCAP -int sync_mode; /* allow sync */ +int sync_mode; /* fork a child to do the capture, and sync between them */ int sync_pipe[2]; /* used to sync father */ int fork_mode; /* fork a child to do the capture */ int quit_after_cap; /* Makes a "capture only mode". Implies -k */ @@ -582,7 +582,7 @@ main(int argc, char *argv[]) cf.cfilter = g_strdup(optarg); break; case 'F': /* Fork to capture */ - fork_mode = 1; + fork_mode = TRUE; break; #endif case 'h': /* Print help and exit */ @@ -623,8 +623,7 @@ main(int argc, char *argv[]) cf.snap = atoi(optarg); break; case 'S': /* "Sync" mode: used for following file ala tail -f */ - sync_mode = 1; - fork_mode = 1; /* -S implies -F */ + sync_mode = TRUE; break; #endif case 't': /* Time stamp type */ @@ -671,7 +670,7 @@ main(int argc, char *argv[]) exit(1); } #ifdef HAVE_LIBPCAP - if (fork_mode) { + if (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')); |