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:
sankalp committed 2026-02-22 02:35:26 +05:45
1 parent 21cada4969
commit 373e64fcad
2 files changed
+9 -8

No files matched your search

-4
View File
@@ -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);