git: 74b1a9ccf9a7 - stable/14 - cp: Remove useless ssize_t cast
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 18 Apr 2024 18:19:00 UTC
The branch stable/14 has been updated by mhorne:
URL: https://cgit.FreeBSD.org/src/commit/?id=74b1a9ccf9a7eab1d4c4c0e4ffc2e901bc040e48
commit 74b1a9ccf9a7eab1d4c4c0e4ffc2e901bc040e48
Author: Collin Funk <collin.funk1@gmail.com>
AuthorDate: 2024-02-13 02:52:58 +0000
Commit: Mitchell Horne <mhorne@FreeBSD.org>
CommitDate: 2024-04-18 18:16:57 +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
(cherry picked from commit 8b864151856fbba97fed16b1200248cf9f6f3ccf)
---
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 0bb5157e3f57..353d35214844 100644
--- a/bin/cp/utils.c
+++ b/bin/cp/utils.c
@@ -97,7 +97,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);