From: Eric Wong Date: Sun, 19 May 2024 21:55:04 +0000 (+0000) Subject: xap_helper.h: use xcalloc to simplify error checking X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6a0aa515b6245255965040327fca7805557dbb9b;p=thirdparty%2Fpublic-inbox.git xap_helper.h: use xcalloc to simplify error checking Since we introduced xcalloc for khashl.h usage, we might as well use it elsewhere. --- diff --git a/lib/PublicInbox/xap_helper.h b/lib/PublicInbox/xap_helper.h index 92d3d12fa..05b3b8c91 100644 --- a/lib/PublicInbox/xap_helper.h +++ b/lib/PublicInbox/xap_helper.h @@ -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);