Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Mar 2024 14:43:19 GMT
From:      Mitchell Horne <mhorne@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 8b864151856f - main - cp: Remove useless ssize_t cast
Message-ID:  <202403211443.42LEhJhV087010@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by mhorne:

URL: https://cgit.FreeBSD.org/src/commit/?id=8b864151856fbba97fed16b1200248cf9f6f3ccf

commit 8b864151856fbba97fed16b1200248cf9f6f3ccf
Author:     Collin Funk <collin.funk1@gmail.com>
AuthorDate: 2024-02-13 02:52:58 +0000
Commit:     Mitchell Horne <mhorne@FreeBSD.org>
CommitDate: 2024-03-21 14:43:04 +0000

    cp: Remove useless ssize_t cast
    
    Both wcount and wresid are ssize_t so this cast is not needed. Just
    remove it so the code is easier to read.
    
    Signed-off-by:  Collin Funk <collin.funk1@gmail.com>
    Reviewed by:    emaste, zlei
    Pull Request:   https://github.com/freebsd/freebsd-src/pull/1116
---
 bin/cp/utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/cp/utils.c b/bin/cp/utils.c
index 80a0c1fce824..6c99d4c63f4a 100644
--- a/bin/cp/utils.c
+++ b/bin/cp/utils.c
@@ -91,7 +91,7 @@ copy_fallback(int from_fd, int to_fd)
 		wcount = write(to_fd, bufp, wresid);
 		if (wcount <= 0)
 			break;
-		if (wcount >= (ssize_t)wresid)
+		if (wcount >= wresid)
 			break;
 	}
 	return (wcount < 0 ? wcount : rcount);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202403211443.42LEhJhV087010>