]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
xap_helper.h: use xcalloc to simplify error checking
authorEric Wong <e@80x24.org>
Sun, 19 May 2024 21:55:04 +0000 (21:55 +0000)
committerEric Wong <e@80x24.org>
Mon, 20 May 2024 18:29:44 +0000 (18:29 +0000)
Since we introduced xcalloc for khashl.h usage, we might as well
use it elsewhere.

lib/PublicInbox/xap_helper.h

index 92d3d12fa1ed17ef1f70f4e8f449f575c94c2a1c..05b3b8c91c0d55dad179e80b99547855d9c6cff7 100644 (file)
@@ -1100,8 +1100,7 @@ int main(int argc, char *argv[])
        CHECK(int, 0, sigdelset(&workerset, SIGTERM));
        CHECK(int, 0, sigdelset(&workerset, SIGCHLD));
        nworker_hwm = nworker;
-       worker_pids = (pid_t *)calloc(nworker, sizeof(pid_t));
-       if (!worker_pids) err(EXIT_FAILURE, "calloc");
+       worker_pids = (pid_t *)xcalloc(nworker, sizeof(pid_t));
 
        if (pipe(pipefds)) err(EXIT_FAILURE, "pipe");
        int fl = fcntl(pipefds[1], F_GETFL);