diff options
Diffstat (limited to 'src/libMsg')
| -rw-r--r-- | src/libMsg/.keep | 0 | ||||
| -rw-r--r-- | src/libMsg/src/Server.cpp | 16 |
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) { |
