aboutsummaryrefslogtreecommitdiffstats
path: root/sharkd_daemon.c
diff options
context:
space:
mode:
authorGuy Harris <gharris@sonic.net>2022-12-22 22:37:45 -0800
committerGerald Combs <gerald@wireshark.org>2022-12-23 23:20:22 +0000
commit13f3ebc4e5c5aa35e8c6e63b442534050943865c (patch)
tree4bb03604e02b62de4d29ae7ebcc9c2b9b2f7d28e /sharkd_daemon.c
parent44511c318d3105c96aa644e141822ed23614f8b9 (diff)
Add a routine to get the path of an executable given the program name.
That reduces the number of get_progfile_dir() calls, leaving only the calls that are done either to 1) get the pathname in order to display it or 2) get the pathname in order to reset the library path. That makes it easier to figure out which get_progfile_dir() calls are made to find the directory in which (non-extcap) binaries from Wireshark are installed and which - if any - are made to figure out the directory in which *the currently-running executable* are stored. (Currently, get_progfile_dir() attemps to get the former, not the latter, so extcaps in an extcap subdirectory, for example, will get the parent directory of that subdirectory, *not* the directory in which they weere installed.)
Diffstat (limited to 'sharkd_daemon.c')
-rw-r--r--sharkd_daemon.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sharkd_daemon.c b/sharkd_daemon.c
index 3b139c8b10..a17a8f4d80 100644
--- a/sharkd_daemon.c
+++ b/sharkd_daemon.c
@@ -423,7 +423,7 @@ sharkd_loop(int argc _U_, char* argv[])
handles[i_handles++] = si.hStdError;
}
- exename = ws_strdup_printf("%s\\%s", get_progfile_dir(), "sharkd.exe");
+ exename = get_executable_path("sharkd");
// we need to pass in all of the command line parameters except the -a parameter
// passing in -a at this point would could a loop, each iteration of which would generate a new session process