From nobody Wed Nov 13 13:49:49 2024 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 4XpPmF3C8Pz5dcy1; Wed, 13 Nov 2024 13:49:49 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XpPmF2K6Cz4kn9; Wed, 13 Nov 2024 13:49:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731505789; 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=tWYQnj+XvF39AvUJK02HfhTRu4osDn2eDHo08J2E/Tw=; b=whMt2MNmB5Umx9iAdXGB3Ec0KaShRQdQ7xhSV1bPXphtMvWSRCGhSDXxVlolf9K1USLuz/ VguAQEfkjf4SJ6o9Y6cVvyVi3rTz3wNRlrVbX2zQ/XNDTOuQD3xg/pV1loUqC3ASoBZxK4 tgHrsz0EjQReuiSUIujeKbcut+4Lr894M6FpaTsCfay+KCf6sGDnryT/CrBvhm3dOEOQNX Z+f5qRxA+daSffCRrVsdpiyaYHywrqMktNlG5BpuVZBj0EoD5XmfjH2HnOiSI1Tdecoo8D mCe8ojC8w35u2ueK0zEiOySRrt6QLfcZAGRpD84uVAqd7DUpL53Ab75sUDVgzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731505789; 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=tWYQnj+XvF39AvUJK02HfhTRu4osDn2eDHo08J2E/Tw=; b=B0YW0ctRLcXwn1wz4o+iDWir44AUCXD+/N1FED41e7aGNMAxRoAnQ8fQmCey8STKGee7l4 HwuicT/z9zWbSYULionAtamlCvHgkiXb/K8K+vRZ53aMNWxsJemE8OGFaLjDq+2pKU9WMR E4IWd+WD2gPu7TWc1evUxfArY8SWdpFJDcC4DKFLhs/0Xp+F20tq6OG6pZRB0g8qkAZlXR pvnhQ8tZ4w8dnKtTkU/FfRV6i/WRhjJoFnC3yn/4sVGRaSx36Jf0EmBUngjVPwP3mrtpp+ hqcpDbaFsD+mquFt7gVoYOVXHGV/t3L9/lMxaTdIj7u+OZiccDzF4c4e3pp2Fg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731505789; a=rsa-sha256; cv=none; b=uk9BHRIIdiPQfrUjD/g7SGPHhVingZmrtVs4+DMHq6Xxj1aMHguEByv2kx82qLfAbhGb2W brftF/81h55LvICfxIb/UmABf0tMuJ9Sn0vITCsdxjzkrhx2xnoo+3HlPCOgY0LJDyIaeJ b0Nzst5A1zmDd/2hx9nAyaBwTztXnLS7xmHyB/wYazgzq/qLDo8K3OvfhJ6Z5WflUkmWOf N0+Q9KsOvZPwMtfZFFQv6iXe7Or2mbJSoEFrhgYj1/vIrl3xvrjC5WdKw9HsO+jgGi6kQK 1VF5WtIEYzCKTM360Nc15y5xp4a2SWzriTGV+61pAtTrOlWqVxhFjW4zN727yA== 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 4XpPmF1wKXzxDv; Wed, 13 Nov 2024 13:49:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4ADDnnb1000215; Wed, 13 Nov 2024 13:49:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4ADDnnNo000212; Wed, 13 Nov 2024 13:49:49 GMT (envelope-from git) Date: Wed, 13 Nov 2024 13:49:49 GMT Message-Id: <202411131349.4ADDnnNo000212@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: b210c33a91ee - main - mv: Type and style nits. 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b210c33a91ee9de41495a03a8bbff81f25be73b9 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=b210c33a91ee9de41495a03a8bbff81f25be73b9 commit b210c33a91ee9de41495a03a8bbff81f25be73b9 Author: Dag-Erling Smørgrav AuthorDate: 2024-11-13 13:47:29 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-11-13 13:47:29 +0000 mv: Type and style nits. Sponsored by: Klara, Inc. Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D47537 --- bin/mv/mv.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/bin/mv/mv.c b/bin/mv/mv.c index 8aea4bbf567c..c3080112cee5 100644 --- a/bin/mv/mv.c +++ b/bin/mv/mv.c @@ -262,18 +262,19 @@ static int fastcopy(const char *from, const char *to, struct stat *sbp) { struct timespec ts[2]; - static u_int blen = MAXPHYS; + struct stat tsb; static char *bp = NULL; + static size_t blen = MAXPHYS; + ssize_t nread; + int from_fd, to_fd; mode_t oldmode; - int nread, from_fd, to_fd; - struct stat tsb; if ((from_fd = open(from, O_RDONLY, 0)) < 0) { warn("fastcopy: open() failed (from): %s", from); return (1); } - if (bp == NULL && (bp = malloc((size_t)blen)) == NULL) { - warnx("malloc(%u) failed", blen); + if (bp == NULL && (bp = malloc(blen)) == NULL) { + warnx("malloc(%zu) failed", blen); (void)close(from_fd); return (1); } @@ -285,7 +286,7 @@ fastcopy(const char *from, const char *to, struct stat *sbp) (void)close(from_fd); return (1); } - while ((nread = read(from_fd, bp, (size_t)blen)) > 0) + while ((nread = read(from_fd, bp, blen)) > 0) if (write(to_fd, bp, (size_t)nread) != nread) { warn("fastcopy: write() failed: %s", to); goto err;