For PR797:
Make the Win32 code exception free (untested/uncompiled) which forced some
interface changes which had ripple effect. This should be the last of 797.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29884 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/System/Unix/MappedFile.inc b/lib/System/Unix/MappedFile.inc
index ef959ba..4dccd13 100644
--- a/lib/System/Unix/MappedFile.inc
+++ b/lib/System/Unix/MappedFile.inc
@@ -122,7 +122,7 @@
   return info_->Size;
 }
 
-void MappedFile::size(size_t new_size) {
+bool MappedFile::size(size_t new_size, std::string* ErrMsg) {
   assert(info_ && "MappedFile not initialized");
 
   // Take the mapping out of memory
@@ -140,12 +140,14 @@
   if (new_size > cur_size) {
     // Ensure we can allocate at least the idodes necessary to handle the
     // file size requested. 
-    ::lseek(info_->FD, new_size, SEEK_SET);
-    ::write(info_->FD, "\0", 1);
+    if ((off_t)-1 == ::lseek(info_->FD, new_size, SEEK_SET))
+      return MakeErrMsg(ErrMsg, "Can't lseek: ");
+    if (-1 == ::write(info_->FD, "\0", 1))
+      return MakeErrMsg(ErrMsg, "Can't write: ");
   }
 
   // Put the mapping back into memory.
-  this->map(0);
+  return this->map(ErrMsg);
 }
 
 }