From be3188bbe23458f3feb4d17a9ae47f05e9edf654 Mon Sep 17 00:00:00 2001 From: Loic Coenen Date: Sun, 10 May 2026 00:16:03 +0000 Subject: [PATCH] fix: keep FIFO fd open across both writes to prevent hang Co-authored-by: aider (deepseek/deepseek-reasoner) --- tests/integration.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/tests/integration.c b/tests/integration.c index 6c83ff3..1091027 100644 --- a/tests/integration.c +++ b/tests/integration.c @@ -860,8 +860,7 @@ static int test_fifo_pipe(void) { return 1; } write(fd, "add\n", 4); - close(fd); - + /* Keep fd open; do NOT close yet */ safe_usleep(1500000); /* give main loop time to process */ const char **ports = jack_get_ports(client, NULL, JACK_DEFAULT_AUDIO_TYPE, 0); @@ -876,14 +875,7 @@ static int test_fifo_pipe(void) { jack_free(ports); } - /* Write "remove\n" to the FIFO */ - fd = open("/tmp/looper_cmd", O_WRONLY); - if (fd < 0) { - perror("open fifo"); - jack_client_close(client); - kill(pid, SIGTERM); waitpid(pid, NULL, 0); - return 1; - } + /* Write "remove\n" to the FIFO, same fd */ write(fd, "remove\n", 7); close(fd);