mirror of
https://github.com/chromium/crashpad.git
synced 2024-12-26 06:31:50 +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) {
|
||||
return true;
|
||||
}
|
||||
if (!FlushWriteBuffer()) {
|
||||
return false;
|
||||
}
|
||||
int fd = fd_;
|
||||
const bool flushed = FlushWriteBuffer();
|
||||
const bool closed = RawLoggingCloseFile(fd_);
|
||||
fd_ = -1;
|
||||
return RawLoggingCloseFile(fd);
|
||||
return flushed && closed;
|
||||
}
|
||||
|
||||
bool IOSIntermediateDumpWriter::AddPropertyCString(IntermediateDumpKey key,
|
||||
|
Loading…
x
Reference in New Issue
Block a user