diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2006-02-12 20:55:11 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2006-02-12 20:55:11 +0000 |
commit | 1b8954ef96c36e9c01e307d866c172ce621177e0 (patch) | |
tree | 00718c0072a7c328e700709386e1c6817de1876c /capture_sync.c | |
parent | a5a21bc16d63c6afb3f85e59bfef877352bae69e (diff) |
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).
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@17277 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'capture_sync.c')
-rw-r--r-- | capture_sync.c | 11 |
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); |