mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-01 15:24:08 +08:00
Ensured close in all paths.
This still needed the EAGAIN logic added
This commit is contained in:
parent
5a0bccf787
commit
b8d3884eb6
@ -78,7 +78,7 @@ public:
|
||||
len = ::read(fd, bytes, MaxBufferLength);
|
||||
|
||||
if (len < 0) {
|
||||
return rv;
|
||||
goto out_close;
|
||||
}
|
||||
|
||||
if (len > 0) {
|
||||
@ -87,7 +87,6 @@ public:
|
||||
}
|
||||
|
||||
} while(len);
|
||||
close(fd);
|
||||
out_crc64 = crc.get();
|
||||
out_size = size;
|
||||
EntryType t;
|
||||
@ -95,6 +94,9 @@ public:
|
||||
out_type = t;
|
||||
rv = 0;
|
||||
}
|
||||
|
||||
out_close:
|
||||
close(fd);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user