Do not try to load the builtin driver if --driver=<file> has been used already.

pull/1167/head
Fredrik Öhrström 2024-02-12 01:16:34 +01:00
rodzic 72ecb86b91
commit 004d8b751f
3 zmienionych plików z 9 dodań i 1 usunięć

Wyświetl plik

@ -456,7 +456,8 @@ collect_copyrights:
3rdparty/xmq/build/default/release/xmq: $(wildcard 3rdparty/xmq/src/main/c/* 3rdparty/xmq/src/main/c/parts/*)
@mkdir -p 3rdparty
@(cd 3rdparty; git clone --depth 1 https://github.com/libxmq/xmq.git; cd xmq; ./configure)
@if [ "$$(cat 3rdparty/xmq/build/default/spec.mk | grep CC)" = "CC:=gcc" ]; then (cd 3rdparty/xmq; make) ; else rm -f $@ ; mkdir -p $$(dirname $@); touch $@ ; echo "Could not build xmq." ; fi
@cat cat 3rdparty/xmq/build/default/spec.mk
@if [ "$$(cat 3rdparty/xmq/build/default/spec.mk | grep CC)" = "CC:=gcc" ]; then (cd 3rdparty/xmq; make VERBOSE=) ; else rm -f $@ ; mkdir -p $$(dirname $@); touch $@ ; echo "Could not build xmq." ; fi
build/xmq: 3rdparty/xmq/build/default/release/xmq
@cp $< $@

Wyświetl plik

@ -70,6 +70,12 @@ bool loadBuiltinDriver(string driver_name)
// Check that there is such a builtin driver.
if (builtins_name_lookup_.count(driver_name) == 0) return false;
if (lookupDriver(driver_name))
{
// A driver has already been loaded! Skip loading the builtin driver.
return true;
}
BuiltinDriver *driver = builtins_name_lookup_[driver_name];
if (driver->loaded) return true;

Wyświetl plik

@ -231,6 +231,7 @@ public:
bool registerDriver(function<void(DriverInfo&di)> setup);
// Lookup (and load if necessary) driver from memory or disk.
DriverInfo *lookupDriver(string name);
bool lookupDriverInfo(const string& driver, DriverInfo *di = NULL);
// Return the best driver match for a telegram.
DriverInfo pickMeterDriver(Telegram *t);