diff options
author | Runxi Yu <me@runxiyu.org> | 2025-04-03 11:31:50 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-04-03 11:32:01 +0800 |
commit | 094244f14e2ec13d1979460278f9067a986fb112 (patch) | |
tree | e9b76f656d3a3224eb9fe2af01ccf4343a0eee2b /git2d | |
parent | git2d: Specify socket path as argument instead of hardcoding (diff) | |
download | forge-094244f14e2ec13d1979460278f9067a986fb112.tar.gz forge-094244f14e2ec13d1979460278f9067a986fb112.tar.zst forge-094244f14e2ec13d1979460278f9067a986fb112.zip |
git2d: Slight cleanup; print error integers to connection for now
Diffstat (limited to 'git2d')
-rw-r--r-- | git2d/main.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/git2d/main.c b/git2d/main.c index b433185..3f253c7 100644 --- a/git2d/main.c +++ b/git2d/main.c @@ -10,6 +10,7 @@ #include <sys/socket.h> #include <sys/types.h> #include <sys/un.h> +#include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> @@ -32,6 +33,7 @@ void * session(void *_conn) { int conn = *(int *)_conn; + free((int *)_conn); #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-but-set-variable" @@ -107,16 +109,12 @@ free_repo: git_repository_free(repo); close: - close(conn); - free((int *)_conn); + // TODO: Implement proper error handling + dprintf(conn, "%d\n", ret); - /* TODO: Handle ret */ + close(conn); return NULL; - - /* TODO: Actually use it properly */ - if (0) - goto close; } int |