diff --git a/src/input/LinuxInput.cpp b/src/input/LinuxInput.cpp index d2a94e94ea..1ace2044cd 100644 --- a/src/input/LinuxInput.cpp +++ b/src/input/LinuxInput.cpp @@ -24,7 +24,8 @@ LinuxInput::LinuxInput(const char *name) : concurrency::OSThread(name) void LinuxInput::deInit() { - close(fd); + if (fd >= 0) + close(fd); } int32_t LinuxInput::runOnce() diff --git a/src/input/LinuxInput.h b/src/input/LinuxInput.h index aa1e8e3402..43d08493cf 100644 --- a/src/input/LinuxInput.h +++ b/src/input/LinuxInput.h @@ -38,7 +38,7 @@ class LinuxInput : public Observable, public concurrency::OS int queue_progress = 0; struct epoll_event events[MAX_EVENTS]; - int fd; + int fd = -1; int ret; uint8_t report[8]; int epollfd; diff --git a/src/platform/portduino/PortduinoGlue.cpp b/src/platform/portduino/PortduinoGlue.cpp index b255c0ce1a..72b2a3bc70 100644 --- a/src/platform/portduino/PortduinoGlue.cpp +++ b/src/platform/portduino/PortduinoGlue.cpp @@ -106,6 +106,8 @@ void portduinoSetup() } } else { std::cout << "No 'config.yaml' found, running simulated." << std::endl; + settingsMap[maxnodes] = 200; // Default to 200 nodes + settingsMap[logoutputlevel] = level_debug; // Default to debug // Set the random seed equal to TCPPort to have a different seed per instance randomSeed(TCPPort); return;