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