From nobody Wed Oct 19 08:01:24 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Msjq869zcz4gDSw; Wed, 19 Oct 2022 08:01:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Msjq84zQ2z3xgM; Wed, 19 Oct 2022 08:01:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666166484; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tUgsfb8j9lg6oRiarY+o1vHvGiELAYmWew511qjYHkg=; b=P5tjoIjJ3MbVAq23Mx0UNtOj2ZY1aWayiGNE1Hb/XBgmZpcs31mKS3603DZ2ufgnNfWUQ0 13nhDmQxrH3m90aNU3GXL7+fBEZepxI1HX3szYIXo42qWydscXK0THGSi+1uNMjnhyvuQi bXZkSGYq/jZRv++xIR/VOjZKOdeS6U5BVP97kVJpeUby+hguIgvalA6gdXqc1DhK/Jv9xi n0/mzPgy0Qhx++1kTDpzbIw9l91jL5ioiuKjEYYykAMUtKi+pwXG8iGJCZVhWnHTL25N74 QyAcRdESfHhzy5c70PCXdh/DEEeJjCUhUJwu00C7H2O9dhlL0y0mYMxHo73jeQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Msjq842mFzSVk; Wed, 19 Oct 2022 08:01:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 29J81Ocd060581; Wed, 19 Oct 2022 08:01:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 29J81Oe7060580; Wed, 19 Oct 2022 08:01:24 GMT (envelope-from git) Date: Wed, 19 Oct 2022 08:01:24 GMT Message-Id: <202210190801.29J81Oe7060580@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: accbb97f87e7 - stable/13 - sort: add wrapper around calloc List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: accbb97f87e7122c0887faece1efc852719c4bdb Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666166484; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tUgsfb8j9lg6oRiarY+o1vHvGiELAYmWew511qjYHkg=; b=XJySWe4fFg5Nta5kLIFOfPDZQmSx8Xe8RLJRXhz34nO0sum2TQCGNbcA4DkLosLxQ/K//D lXsbYEi1VEUfVKuBe/nDyYi52TZXnTdOhceA3G2AW/H+Gfmef2VYwic90SG0XkoPeZ46TJ Mtkpu3GZR+Av/fWuxXXVU9gLNIb+7FYeJGyT1TZNonl9o4I+Qu6TgAn08kQPScFPKDHya3 zU6Owig4UkwwXTyetsL5stiAbT+PZ2QP3/4tMA72P1FrlVWe8YmwrcKZ19MhzdNcCP0zB4 fdmbuDfQu6pT8IM7EguUkwnxhaQBAzLlJsi92TROpEC1vS8r0Yo5qNSizxPYGg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1666166484; a=rsa-sha256; cv=none; b=uyaY8AX/e12njkiguHi2eqlRJsGs4tJKO068w4tz51qyIuSH/bDWxABe2aHBTToZqJ1aW4 6BWN+jz3WGkPvASISzQEdrKfOQuf6uOSIBakaFnoMuiq1VUdUguL2n7xk7Y0/utev6UnEZ Y0pxQpwgWq0AWf1BZhVSj9LOpY9A+hpOr7akbvog9T7SPuT34UJrza+uNXtMIcBPrSqSxH ZR7z8S2d3C/ZI2eu03gJXpQbQnsgyeTyeSNe4XHsh6FUaEy2ANMlSvv/CKm9FDeIx9o+/b rzqiNSOz9iQpZf47WH1n4iTP4XYMT9Y7nzvPFvSfMu519LI1Hc4mWT+0bIfvNQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=accbb97f87e7122c0887faece1efc852719c4bdb commit accbb97f87e7122c0887faece1efc852719c4bdb Author: Baptiste Daroussin AuthorDate: 2022-10-12 13:52:38 +0000 Commit: Baptiste Daroussin CommitDate: 2022-10-19 07:56:51 +0000 sort: add wrapper around calloc (cherry picked from commit a312f3e74286c9bccd498198bfd236c49916d891) --- usr.bin/sort/mem.c | 10 ++++++++++ usr.bin/sort/mem.h | 1 + 2 files changed, 11 insertions(+) diff --git a/usr.bin/sort/mem.c b/usr.bin/sort/mem.c index dea37bb3a110..18794666da51 100644 --- a/usr.bin/sort/mem.c +++ b/usr.bin/sort/mem.c @@ -36,6 +36,16 @@ __FBSDID("$FreeBSD$"); #include "mem.h" +void* +sort_calloc(size_t nb, size_t size) +{ + void *ptr; + + if ((ptr = calloc(nb, size)) == NULL) + err(2, NULL); + return (ptr); +} + /* * malloc() wrapper. */ diff --git a/usr.bin/sort/mem.h b/usr.bin/sort/mem.h index cb21d6d4a221..6a4edcd59161 100644 --- a/usr.bin/sort/mem.h +++ b/usr.bin/sort/mem.h @@ -39,6 +39,7 @@ /* * mem.c */ +void *sort_calloc(size_t, size_t); void *sort_malloc(size_t); void sort_free(const void *ptr); void *sort_realloc(void *, size_t);