about summary refs log tree commit diff
path: root/src/references.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2003-07-20T21·11+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2003-07-20T21·11+0000
commit7984cfc7c18c85c5db42c5c7d57927b12c846ce0 (patch)
treea728a7500892e4de089c090538cb8fd34e4a1ffa /src/references.cc
parent667a6afb9dabcb3e5c851b910705b7eb1c87c9b6 (diff)
* Argh, another short-write problem. Added wrappers around
  read()/write() to fix this once and for all.

Diffstat (limited to 'src/references.cc')
-rw-r--r--src/references.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/references.cc b/src/references.cc
index a42c1aed02c1..8934d53061cd 100644
--- a/src/references.cc
+++ b/src/references.cc
@@ -55,12 +55,11 @@ void checkPath(const string & path,
         int fd = open(path.c_str(), O_RDONLY);
         if (fd == -1) throw SysError(format("opening file `%1%'") % path);
 
-        char * buf = new char[st.st_size];
+        unsigned char * buf = new unsigned char[st.st_size];
 
-        if (read(fd, buf, st.st_size) != st.st_size)
-            throw SysError(format("reading file %1%") % path);
+        readFull(fd, buf, st.st_size);
 
-        search(string(buf, st.st_size), ids, seen);
+        search(string((char *) buf, st.st_size), ids, seen);
         
         delete buf; /* !!! autodelete */