diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2006-05-01 06:51:14 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2006-05-01 06:51:14 +0000 |
commit | 41879960b28d0c33444ef1fc23c6da230dc42fc3 (patch) | |
tree | d89d037d5ac2d66e245060575b23e2f9f8437b3c /capture_sync.c | |
parent | ae0f10c344819efc930b39f06c026e49cded7d3e (diff) |
Handle the case where we *can't* determine the pathname in which to find
programs, by reporting it with a dialog box that at least attempts to
indicate what the problem is, and by giving up early on running dumpcap.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@18051 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'capture_sync.c')
-rw-r--r-- | capture_sync.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/capture_sync.c b/capture_sync.c index cd2c8d8452..091c782a97 100644 --- a/capture_sync.c +++ b/capture_sync.c @@ -241,6 +241,7 @@ sync_pipe_start(capture_options *capture_opts) { enum PIPES { PIPE_READ, PIPE_WRITE }; /* Constants 0 and 1 for PIPE_READ and PIPE_WRITE */ #endif int sync_pipe_read_fd; + const char *progfile_dir; char *exename; int argc; const char **argv; @@ -251,6 +252,13 @@ sync_pipe_start(capture_options *capture_opts) { capture_opts->fork_child = -1; + progfile_dir = get_progfile_dir(); + if (progfile_dir == NULL) { + /* We don't know where to find dumpcap. */ + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "We don't know where to find dumpcap."); + return FALSE; + } + /* Allocate the string pointer array with enough space for the terminating NULL pointer. */ argc = 0; @@ -258,8 +266,7 @@ sync_pipe_start(capture_options *capture_opts) { *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()); + exename = g_strdup_printf("%s" G_DIR_SEPARATOR_S "dumpcap", progfile_dir); /* Make that the first argument in the argument list (argv[0]). */ argv = sync_pipe_add_arg(argv, &argc, exename); |