1
0
mirror of https://git.sr.ht/~sircmpwn/gmnisrv synced 2024-12-04 14:46:42 -05:00

Log bind addresses on startup

This commit is contained in:
Drew DeVault 2020-09-24 11:15:04 -04:00
parent b14e33c349
commit 85a85b37f8
2 changed files with 6 additions and 1 deletions

View File

@ -10,6 +10,7 @@ server_logf(FILE *f, const char *fmt, va_list ap)
{
fprintf(f, "<server>\t");
vfprintf(f, fmt, ap);
fprintf(f, "\n");
}
static void
@ -22,6 +23,7 @@ client_logf(FILE *f, struct sockaddr *addr, const char *fmt, va_list ap)
fprintf(f, "%s\t", addrs);
vfprintf(f, fmt, ap);
fprintf(f, "\n");
}
void

View File

@ -73,6 +73,7 @@ server_init(struct gmnisrv_server *server, struct gmnisrv_config *conf)
}
r = listen(sockfd, 16);
server_log("listening on %s", b->name);
server->fds[i].fd = sockfd;
server->fds[i].events = POLLIN;
@ -195,6 +196,8 @@ server_run(struct gmnisrv_server *server)
r = sigaction(SIGTERM, &act, &oterm);
assert(r == 0);
server_log("gmnisrv started");
server->run = true;
do {
r = poll(server->fds, server->nfds, -1);
@ -229,7 +232,7 @@ server_run(struct gmnisrv_server *server)
}
} while (server->run);
server_log("Terminating.");
server_log("gmnisrv terminating");
r = sigaction(SIGINT, &oint, NULL);
assert(r == 0);