commit bffec1be6a98d9bcb8d82ffbb6d54f1f0e27003b
parent 360e4ba7f3c2129d0b650bf4b2e9e1adb1302eff
Author: Jacob R. Edwards <jacob@jacobedwards.org>
Date: Sun, 4 Jun 2023 19:57:12 -0700
Unlink the socket in die() if it exists
In some places, die() is called after the server is setup. This
leaves a defunct socket in the filesystem which would require manual
removal before the server could be started again.
Diffstat:
1 file changed, 2 insertions(+), 0 deletions(-)
diff --git a/aps/main.c b/aps/main.c
@@ -45,6 +45,8 @@ void
die(char *s)
{
aps_log(NULL, 0, FATAL, NULL, "%s: %s", s, errstr);
+ if (aps)
+ unlink(aps->con->path);
exit(1);
}