diff options
author | Guy Harris <guy@alum.mit.edu> | 2006-05-01 06:51:14 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2006-05-01 06:51:14 +0000 |
commit | 0dfbc73cbedd0d1b88218eb594f88bc98c583faf (patch) | |
tree | d89d037d5ac2d66e245060575b23e2f9f8437b3c /capture_sync.c | |
parent | 56728f40ede189fd4d6fed7e416cb9ec6cda3520 (diff) | |
download | wireshark-0dfbc73cbedd0d1b88218eb594f88bc98c583faf.tar.gz wireshark-0dfbc73cbedd0d1b88218eb594f88bc98c583faf.tar.bz2 wireshark-0dfbc73cbedd0d1b88218eb594f88bc98c583faf.zip |
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.
svn path=/trunk/; revision=18051
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); |