Move some initialization closer to the client.
This commit is contained in:
5
client.c
5
client.c
@@ -5,6 +5,7 @@
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <signal.h>
|
||||
|
||||
#include "common.h"
|
||||
#include "json.h"
|
||||
@@ -38,6 +39,10 @@ struct serializer {
|
||||
#define NUM_SERIALIZERS (sizeof(serializers) / sizeof(*serializers))
|
||||
|
||||
|
||||
void client_init() {
|
||||
signal(SIGPIPE, SIG_IGN);
|
||||
}
|
||||
|
||||
static void client_hangup(struct client *client) {
|
||||
fprintf(stderr, "C %s (%s): Client disconnected\n", client->id, client->serializer->name);
|
||||
if (client->prev) {
|
||||
|
||||
Reference in New Issue
Block a user