summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2006-02-12 20:55:11 +0000
committerGuy Harris <guy@alum.mit.edu>2006-02-12 20:55:11 +0000
commit4d94f994b56be336d459ebd4585a46a8b6d8c4c1 (patch)
tree00718c0072a7c328e700709386e1c6817de1876c
parent3607862994ecf8e8552df6eb11e23b6d762a81fd (diff)
downloadwireshark-4d94f994b56be336d459ebd4585a46a8b6d8c4c1.tar.gz
At least on UN*X, the first argument - argv[0] - is supposed to be the
name of the program as used to run it (command name/path name). Pass that - otherwise, we pass "-i" as argv[0], and dumpcap ignores it and treats the capture device as the first argument and doesn't handle it correctly (i.e., it doesn't capture on that device). svn path=/trunk/; revision=17277
-rw-r--r--capture_sync.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/capture_sync.c b/capture_sync.c
index 0edc715f3c..e013f699ea 100644
--- a/capture_sync.c
+++ b/capture_sync.c
@@ -334,6 +334,13 @@ sync_pipe_start(capture_options *capture_opts) {
argv = g_malloc(sizeof (char *));
*argv = NULL;
+ /* take ethereal's absolute program path and replace ethereal with dumpcap */
+ exename = g_strdup_printf("%s" G_DIR_SEPARATOR_S "dumpcap",
+ get_progfile_dir());
+
+ /* Make that the first argument in the argument list (argv[0]). */
+ argv = sync_pipe_add_arg(argv, &argc, exename);
+
argv = sync_pipe_add_arg(argv, &argc, "-i");
argv = sync_pipe_add_arg(argv, &argc, capture_opts->iface);
@@ -406,10 +413,6 @@ sync_pipe_start(capture_options *capture_opts) {
argv = sync_pipe_add_arg(argv, &argc, "-Z");
#endif
- /* take ethereal's absolute program path and replace ethereal with dumpcap */
- exename = g_strdup_printf("%s" G_DIR_SEPARATOR_S "dumpcap",
- get_progfile_dir());
-
#ifdef _WIN32
argv = sync_pipe_add_arg(argv, &argc, "-B");
g_snprintf(buffer_size, ARGV_NUMBER_LEN, "%d",capture_opts->buffer_size);