From f66472ada5ed9d137ff593cf97dd443666f7a860 Mon Sep 17 00:00:00 2001 From: Mikhail Burakov Date: Sat, 7 Jan 2023 11:20:10 +0100 Subject: Return error state on failed lua initialization --- main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.c b/main.c index c4fc5c0..9b760eb 100644 --- a/main.c +++ b/main.c @@ -408,8 +408,8 @@ static void OnMqttSubscribeAck(void* user, bool success) { g_service.lua_state = luaL_newstate(); if (!g_service.lua_state) { - LOGW("Failed to allocate lua state (%s)", strerror(errno)); - OnSignal(SIGTERM); + LOGE("Failed to allocate lua state (%s)", strerror(errno)); + OnSignal(SIGABRT); return; } @@ -421,8 +421,8 @@ static void OnMqttSubscribeAck(void* user, bool success) { DIR* current_dir = opendir("."); if (!current_dir) { - LOGW("Failed to open current dir (%s)", strerror(errno)); - OnSignal(SIGTERM); + LOGE("Failed to open current dir (%s)", strerror(errno)); + OnSignal(SIGABRT); return; } for (struct dirent* item; (item = readdir(current_dir));) { -- cgit v1.2.3