mirror of
https://github.com/clearlinux/clr-debug-info.git
synced 2026-09-06 22:01:32 +00:00
nica/files: Ensure we really do break on a read error
Previously nc_copy_file would return true regardless of a source read error, flagged in analysis. Ensure we bypass the set of ret to true and return the correct value in all instances. Signed-off-by: Ikey Doherty <michael.i.doherty@intel.com>
This commit is contained in:
+1
-1
@@ -113,7 +113,7 @@ bool nc_copy_file(const char *src, const char *dst, mode_t mode, bool remove_tar
|
||||
while (true) {
|
||||
if ((r = read(src_fd, &buffer, sizeof(buffer))) < 0) {
|
||||
ret = false;
|
||||
break;
|
||||
goto end;
|
||||
}
|
||||
if (write(dest_fd, buffer, sizeof(buffer)) != r) {
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user