summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorMikhail Burakov <mburakov@mailbox.org>2023-01-07 11:20:10 +0100
committerMikhail Burakov <mburakov@mailbox.org>2023-01-07 11:20:10 +0100
commitf66472ada5ed9d137ff593cf97dd443666f7a860 (patch)
tree6f523e01a542e9f575d641a3b7070520bf00c422 /main.c
parentd62c48945382a440a5e91876a58a1d91e3da5b1d (diff)
Return error state on failed lua initialization
Diffstat (limited to 'main.c')
-rw-r--r--main.c8
1 files 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));) {