mirror of
https://github.com/systemd/systemd.git
synced 2024-12-23 21:35:11 +03:00
copy: reduce number of checks
We check max_bytes twice here, let's simplify that, and reduce one level of indentation.
This commit is contained in:
parent
75036dce94
commit
dd641ad1b8
@ -169,13 +169,11 @@ int copy_bytes_full(
|
|||||||
for (;;) {
|
for (;;) {
|
||||||
ssize_t n;
|
ssize_t n;
|
||||||
|
|
||||||
if (max_bytes != (uint64_t) -1) {
|
|
||||||
if (max_bytes <= 0)
|
if (max_bytes <= 0)
|
||||||
return 1; /* return > 0 if we hit the max_bytes limit */
|
return 1; /* return > 0 if we hit the max_bytes limit */
|
||||||
|
|
||||||
if (m > max_bytes)
|
if (max_bytes != UINT64_MAX && m > max_bytes)
|
||||||
m = max_bytes;
|
m = max_bytes;
|
||||||
}
|
|
||||||
|
|
||||||
/* First try copy_file_range(), unless we already tried */
|
/* First try copy_file_range(), unless we already tried */
|
||||||
if (try_cfr) {
|
if (try_cfr) {
|
||||||
|
Loading…
Reference in New Issue
Block a user