From: Dmitry Y. <di...@us...> - 2007-05-16 07:49:02
|
Build Version : T2.1.0.15809 Firebird 2.1 Beta 1 (writeBuildNum.sh,v 1.15966 2007/05/16 07:49:00 dimitr Exp ) Update of /cvsroot/firebird/firebird2/src/jrd/os/win32 In directory sc8-pr-cvs17:/tmp/cvs-serv32753 Modified Files: config_root.cpp Log Message: Added remote process name to the monitoring data. Applications are allowed to override this value via DPB. Index: config_root.cpp =================================================================== RCS file: /cvsroot/firebird/firebird2/src/jrd/os/win32/config_root.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -b -U3 -r1.19 -r1.20 --- config_root.cpp 29 Nov 2005 14:25:34 -0000 1.19 +++ config_root.cpp 16 May 2007 07:48:59 -0000 1.20 @@ -76,15 +76,9 @@ #endif // get the pathname of the running executable - string bin_dir; + string bin_dir = fb_utils::get_process_name(); + if (bin_dir.length() != 0) { - // Given the current semantics of PathName, when "buffer" goes - // out of scope, it's already bitwise copied into bin_dir. - char buffer[MAXPATHLEN]; - GetModuleFileName(NULL, buffer, sizeof(buffer)); - bin_dir = buffer; - } - // get rid of the filename int index = bin_dir.rfind(PathUtils::dir_sep); bin_dir = bin_dir.substr(0, index); @@ -99,5 +93,10 @@ // go to the parent directory index = bin_dir.rfind(PathUtils::dir_sep, bin_dir.length()); root_dir = (index ? bin_dir.substr(0, index) : bin_dir) + PathUtils::dir_sep; + return; + } + + // As a last resort get it from the default install directory + root_dir = FB_PREFIX; } |