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:
parent
b14e33c349
commit
85a85b37f8
@ -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
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user