Pi66

Home | Repos | About | Blog | Gaza

sta
minimal & simple status monitoring app.
git clone https://git.pi66.xyz/sta

About | Files | Commits | Refs | License


fix: return after run_client() success

Author: pi66
Date: 2026-05-21 19:27
commit: b13c8c42

Stat

M sta.c 7 +4 -3

Diff

diff --git a/sta.c b/sta.c
index 36a11d2..b95ac27 100644
--- a/sta.c
+++ b/sta.c
@@ -235,11 +235,12 @@ int main(int argc, char const *argv[])
 
 	if (access(SOCKET_PATH, F_OK) == 0) {
 		run_client(argc, argv, &addr, sock);
-	} else {
-		die("ERROR: server not running (no socket at " SOCKET_PATH ")");
+		goto clean_up;
 	}
 
-	close(sock);
+	warn("ERROR: server not running (no socket at " SOCKET_PATH ")");
 	unlink(SOCKET_PATH);
+clean_up:
+	close(sock);
 	return 0;
 }

// Created by Pi66

// Copyright ©Pi66 2026