From 26d6b159f3b9d624992f5da432fa8f7f9ac897c5 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 22 Oct 2008 15:42:16 -0700 Subject: [PATCH] Make it possible to open more than one vlog client socket at a time. --- lib/vlog-socket.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/vlog-socket.c b/lib/vlog-socket.c index 43d0acb26..7fffc1317 100644 --- a/lib/vlog-socket.c +++ b/lib/vlog-socket.c @@ -285,6 +285,7 @@ struct vlog_client { int vlog_client_connect(const char *path, struct vlog_client **clientp) { + static int counter; struct vlog_client *client; int fd; @@ -293,7 +294,8 @@ vlog_client_connect(const char *path, struct vlog_client **clientp) ? xstrdup(path) : xasprintf("/tmp/vlogs.%s", path)); - client->bind_path = xasprintf("/tmp/vlog.%ld", (long int) getpid()); + client->bind_path = xasprintf("/tmp/vlog.%ld.%d", + (long int) getpid(), counter++); fd = make_unix_socket(SOCK_DGRAM, false, false, client->bind_path, client->connect_path); -- 2.45.2