From 5764a7698e671d4185debd7bfe2661ea0633b215 Mon Sep 17 00:00:00 2001 From: kento2 Date: Fri, 4 Sep 2026 21:26:08 +0200 Subject: [PATCH] supress aria2c stdout --- pkin/pkin/pkin_pkg_fetch_start.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkin/pkin/pkin_pkg_fetch_start.c b/pkin/pkin/pkin_pkg_fetch_start.c index 6e963d0..887bad3 100644 --- a/pkin/pkin/pkin_pkg_fetch_start.c +++ b/pkin/pkin/pkin_pkg_fetch_start.c @@ -1,4 +1,5 @@ #include +#include #include #include #include "../pkin.h" @@ -7,6 +8,7 @@ int pkin_fetch_start(pkin_fetch_queue *queue) { char **fetchcmd; + int nullfd; pid_t pid; if (buffer_flush(&queue->writeb) < 0) { carpsys("write to pipe"); @@ -15,13 +17,16 @@ int pkin_fetch_start(pkin_fetch_queue *queue) close(queue->pipefd[1]); fetchcmd = (char *[]){"aria2c", "-i", "-", NULL}; - pid = pkin__spawn(fetchcmd, queue->pipefd[0], 1, 2); + nullfd = open_write("/dev/null"); + pid = pkin__spawn(fetchcmd, queue->pipefd[0], nullfd < 0 ? 1 : nullfd, 2); if (pid < 0) { + close(nullfd); carp("failed spawning aria2c to fetch files"); return 0; } if (waitpid(pid, NULL, 0) < 0) { + close(nullfd); carp("waitpid"); return 0; }