aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhybrid <hybrid@hybridlabs.pro>2026-06-02 12:03:12 +0300
committerhybrid <hybrid@hybridlabs.pro>2026-06-02 12:03:12 +0300
commit37d0ce9c59365dc1dd12d71be316d95e79b0c09a (patch)
tree2983c11047651f54c8830eaaa494ebdc2ff8bdd9
parentc9fd8157533ab6baabb0eb5ca4d3611212f148f6 (diff)
downloadcgit_auth-37d0ce9c59365dc1dd12d71be316d95e79b0c09a.tar.gz
cgit_auth-37d0ce9c59365dc1dd12d71be316d95e79b0c09a.tar.bz2
cgit_auth-37d0ce9c59365dc1dd12d71be316d95e79b0c09a.zip
try: syslog implementation
Diffstat (limited to '')
-rw-r--r--src/main.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index a0318ef..53fd0b2 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1,6 +1,25 @@
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
+
+#include <sys/syslog.h>
+#include <syslog.h>
int main(int argc, char **argv) {
+ char *str = NULL;
+ size_t n = 0;
+
+ openlog(NULL, LOG_PID, LOG_LOCAL0);
+
+ for (int i = 0; i < argc; i++)
+ n += strlen(*argv+i);
+
+ if ((str = malloc(n + 1)) == NULL) {
+ perror("main: malloc failed");
+ exit(EXIT_FAILURE);
+ }
+
+ syslog(LOG_DEBUG, "args: %s\n", str);
+
return 0;
}