mirror of
https://github.com/chromium/crashpad.git
synced 2024-12-27 15:32:10 +08:00
ios: Always reset IOSIntermediateDumpWriter file descriptor on close.
Always reset the file descriptor to -1, even if FlushWriteBuffer or RawLoggingCloseFile fails. Bug: 1431760 Change-Id: I193f526d65f477bba002dd9faf68996020e48a3b Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4406657 Reviewed-by: Ben Hamilton <benhamilton@google.com> Commit-Queue: Justin Cohen <justincohen@chromium.org> Reviewed-by: Robert Sesek <rsesek@chromium.org>
This commit is contained in:
parent
4773a37f0a
commit
ada8dfa4a7
@ -83,12 +83,10 @@ bool IOSIntermediateDumpWriter::Close() {
|
|||||||
if (fd_ < 0) {
|
if (fd_ < 0) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!FlushWriteBuffer()) {
|
const bool flushed = FlushWriteBuffer();
|
||||||
return false;
|
const bool closed = RawLoggingCloseFile(fd_);
|
||||||
}
|
|
||||||
int fd = fd_;
|
|
||||||
fd_ = -1;
|
fd_ = -1;
|
||||||
return RawLoggingCloseFile(fd);
|
return flushed && closed;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IOSIntermediateDumpWriter::AddPropertyCString(IntermediateDumpKey key,
|
bool IOSIntermediateDumpWriter::AddPropertyCString(IntermediateDumpKey key,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user