feat(include/common): add thread‑safe logging macros and error handling
- New Features - Wrap log output with flockfile/funlockfile to guarantee atomic writes. - Add LOG_PERROR macro to report messages with errno details. - Enhancements - Include <errno.h> and <string.h> for robust error handling. - Remove unused errorf declaration. - Bug Fixes - None.
This commit is contained in:
2 files changed
+9
-8
No files matched your search
@@ -8,10 +8,6 @@
|
||||
// Returns 1 on success, 0 on truncation/error
|
||||
int safe_snprintf(char *dst, size_t dst_sz, const char *fmt, ...);
|
||||
|
||||
// fprintf to stderr with printf-style formatting. Returns 1 for convenient
|
||||
// `return errorf(...)` usage.
|
||||
int errorf(const char *fmt, ...);
|
||||
|
||||
// Common runtime helpers
|
||||
const char *get_runtime_dir(void);
|
||||
void build_pidfile_path(char *buffer, size_t buflen);
|
||||
|
||||
Reference in new issue
Block a user