Use the ability to pwrite to simplify the ELF writer.
[oota-llvm.git] / lib / Support / raw_ostream.cpp
index 044f8e0ca86404bc0deabbd8b2c60906d7391fcd..6f9f910cad9f05291fe55bd971c221be2261122b 100644 (file)
@@ -625,7 +625,7 @@ void raw_fd_ostream::close() {
 uint64_t raw_fd_ostream::seek(uint64_t off) {
   flush();
   pos = ::lseek(FD, off, SEEK_SET);
-  if (pos != off)
+  if (pos == (uint64_t)-1)
     error_detected();
   return pos;
 }