Force stdout to be line buffered - this fixes logs ending early if meshtasticd crashes (#8499)

This commit is contained in:
Chloe Bethel
2025-10-31 05:54:35 -05:00
committed by GitHub
co-authored by GitHub
parent c145be8e05
commit de83b448f9
+5
View File
@@ -37,6 +37,8 @@ bool yamlOnly = false;
const char *argp_program_version = optstr(APP_VERSION);
char stdoutBuffer[512];
// FIXME - move setBluetoothEnable into a HALPlatform class
void setBluetoothEnable(bool enable)
{
@@ -154,6 +156,9 @@ void portduinoSetup()
std::string gpioChipName = "gpiochip";
portduino_config.displayPanel = no_screen;
// Force stdout to be line buffered
setvbuf(stdout, stdoutBuffer, _IOLBF, sizeof(stdoutBuffer));
if (portduino_config.force_simradio == true) {
portduino_config.lora_module = use_simradio;
} else if (configPath != nullptr) {