mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-12 14:06:36 +00:00
Try again if write(2) reports an recoverable error.
This should fix mysteriously crashing boost regression tests when stderr is managed by bjam (PR7043). llvm-svn: 103085
This commit is contained in:
parent
7e52958e05
commit
8712466dd6
@ -21,6 +21,7 @@
|
||||
#include "llvm/Support/ErrorHandling.h"
|
||||
#include "llvm/ADT/STLExtras.h"
|
||||
#include <cctype>
|
||||
#include <cerrno>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
@ -420,7 +421,11 @@ raw_fd_ostream::~raw_fd_ostream() {
|
||||
void raw_fd_ostream::write_impl(const char *Ptr, size_t Size) {
|
||||
assert(FD >= 0 && "File already closed.");
|
||||
pos += Size;
|
||||
if (::write(FD, Ptr, Size) != (ssize_t) Size)
|
||||
ssize_t ret;
|
||||
do {
|
||||
ret = ::write(FD, Ptr, Size);
|
||||
} while (ret < 0 && (errno == EAGAIN || errno == EINTR));
|
||||
if (ret != (ssize_t) Size)
|
||||
error_detected();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user