diff --git a/modules/database/src/std/softIoc/softMain.cpp b/modules/database/src/std/softIoc/softMain.cpp index bc945c80e..9d9f080cb 100644 --- a/modules/database/src/std/softIoc/softMain.cpp +++ b/modules/database/src/std/softIoc/softMain.cpp @@ -96,10 +96,11 @@ void errIf(int ret, const std::string& msg) throw std::runtime_error(msg); } +bool lazy_dbd_loaded; + void lazy_dbd(const std::string& dbd_file) { - static bool loaded; - if(loaded) return; - loaded = true; + if(lazy_dbd_loaded) return; + lazy_dbd_loaded = true; errIf(dbLoadDatabase(dbd_file.c_str(), NULL, NULL), std::string("Failed to load DBD file: ")+dbd_file); @@ -142,7 +143,7 @@ int main(int argc, char *argv[]) int opt; - while ((opt = getopt(argc, argv, "ha:d:m:Ssx:")) != -1) { + while ((opt = getopt(argc, argv, "ha:D:d:m:Ssx:")) != -1) { switch (opt) { case 'h': /* Print usage */ usage(argv[0], dbd_file); @@ -164,6 +165,12 @@ int main(int argc, char *argv[]) throw std::bad_alloc(); std::cout<<"asSetFilename(\""<