Make it possible to open more than one vlog client socket at a time.
authorBen Pfaff <blp@nicira.com>
Wed, 22 Oct 2008 22:42:16 +0000 (15:42 -0700)
committerBen Pfaff <blp@nicira.com>
Thu, 23 Oct 2008 17:58:24 +0000 (10:58 -0700)
lib/vlog-socket.c

index 43d0acb268a4042bef604ff4a8b37bd57ced3eac..7fffc13170ad68db3d086e74394e3f2e0e34119c 100644 (file)
@@ -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);