From b0cffd8198f34261c618c47daeb99d9112e88a3e Mon Sep 17 00:00:00 2001 From: Francesco Cozzuto Date: Sun, 22 Feb 2026 00:41:01 +0100 Subject: [PATCH] Make client ID random in example --- examples/example.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/example.c b/examples/example.c index c3fc018..7e21d17 100644 --- a/examples/example.c +++ b/examples/example.c @@ -15,6 +15,7 @@ * LD_LIBRARY_PATH=. ./example */ +#include #include #include #include @@ -36,6 +37,8 @@ static const char *error_name(ToastyFS_Error e) int main(void) { + srand(time(NULL)); + /* Cluster addresses (mapped via docker-compose ports). * These must be writable char arrays because parse_addr_arg * temporarily modifies the string in-place. */ @@ -45,7 +48,7 @@ int main(void) char *addrs[] = { addr1, addr2, addr3 }; printf("Connecting to cluster...\n"); - ToastyFS *tfs = toastyfs_init(1, addrs, 3); + ToastyFS *tfs = toastyfs_init(rand(), addrs, 3); if (tfs == NULL) { fprintf(stderr, "toastyfs_init failed\n"); return 1;