summaryrefslogtreecommitdiffhomepage
path: root/src/libMsg
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2026-03-26 10:25:04 +0100
committerAmlal El Mahrouss <amlal@nekernel.org>2026-03-26 10:25:04 +0100
commit349b2aa2e14d3fc2ffadfe629870e6af8f4652f0 (patch)
tree69a67058f4d9f34abc2560c1d54343f3b1ed983a /src/libMsg
parentcfbf446b2cf962b08051638b41b7bb617d9ca538 (diff)
[FEAT] src/lib: System libraries fixes.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'src/libMsg')
-rw-r--r--src/libMsg/.keep0
-rw-r--r--src/libMsg/src/Server.cpp16
2 files changed, 8 insertions, 8 deletions
diff --git a/src/libMsg/.keep b/src/libMsg/.keep
deleted file mode 100644
index e69de29b..00000000
--- a/src/libMsg/.keep
+++ /dev/null
diff --git a/src/libMsg/src/Server.cpp b/src/libMsg/src/Server.cpp
index a2f17e91..ed043d0b 100644
--- a/src/libMsg/src/Server.cpp
+++ b/src/libMsg/src/Server.cpp
@@ -4,37 +4,37 @@
// Official repository: https://github.com/ne-foss-org/nekernel
#include <libMsg/MsgKit/Server.h>
+#include <libSystem/SystemKit/Err.h>
static libmsg_func_type* kFuncs{nullptr};
static SizeT kFuncCnt{0};
static SemaphoreRef kSemaphore{nullptr};
IMPORT_C UInt32 libmsg_close_library(Void) {
- if (kSemaphore) return 0;
+ if (kSemaphore) return kErrorInvalidData;
kFuncs = nullptr;
kFuncCnt = 0;
- return 0;
+ return kErrorSuccess;
}
IMPORT_C UInt32 libmsg_eval_expr(struct LIBMSG_EXPR* head, VoidPtr arg, SizeT arg_size) {
- if (kSemaphore) return 0;
+ if (kSemaphore) return kErrorInvalidData;
+ if (!head) return kErrorInvalidData;
- if (!head) return 0;
-
- static kSemWaitTime = 1000;
+ static auto kSemWaitTime = 1000;
kSemaphore = ::SemCreate(kSemWaitTime, kSemWaitTime, "libmsg_semaphore");
- if (!kSemaphore) return 0;
+ if (!kSemaphore) return kErrorInvalidData;
kFuncs[head->l_index](head, arg, arg_size);
::SemClose(kSemaphore);
kSemaphore = nullptr;
- return 0;
+ return kErrorSuccess;
}
IMPORT_C Void libmsg_init_library(libmsg_func_type* funcs, SizeT cnt) {