File tree 1 file changed +8
-12
lines changed
1 file changed +8
-12
lines changed Original file line number Diff line number Diff line change 27
27
#include " ../common/classes/init.h"
28
28
#include " ../common/dllinst.h"
29
29
#include " ../common/os/fbsyslog.h"
30
+ #include " ../common/os/path_utils.h"
30
31
#include " ../common/utils_proto.h"
31
32
#include " ../jrd/constants.h"
32
33
#include " firebird/Interface.h"
@@ -60,22 +61,17 @@ class ConfigImpl : public Firebird::PermanentStorage
60
61
explicit ConfigImpl (Firebird::MemoryPool& p)
61
62
: Firebird::PermanentStorage(p), missConf(false )
62
63
{
63
- try
64
+ const auto fullName = fb_utils::getPrefix (Firebird::IConfigManager::DIR_CONF, Firebird::CONFIG_FILE);
65
+ missConf = !PathUtils::canAccess (fullName, 0 );
66
+
67
+ if (missConf)
64
68
{
65
- ConfigFile file (fb_utils::getPrefix (Firebird::IConfigManager::DIR_CONF, Firebird::CONFIG_FILE),
66
- ConfigFile::ERROR_WHEN_MISS);
69
+ ConfigFile file (ConfigFile::USE_TEXT, " " );
67
70
defaultConfig = FB_NEW Firebird::Config (file);
68
71
}
69
- catch ( const Firebird::status_exception& ex)
72
+ else
70
73
{
71
- if (ex.value ()[1 ] != isc_miss_config)
72
- {
73
- throw ;
74
- }
75
-
76
- missConf = true ;
77
-
78
- ConfigFile file (ConfigFile::USE_TEXT, " " );
74
+ ConfigFile file (fullName, ConfigFile::ERROR_WHEN_MISS);
79
75
defaultConfig = FB_NEW Firebird::Config (file);
80
76
}
81
77
}
You can’t perform that action at this time.
0 commit comments