about summary refs log tree commit diff
path: root/src/libnix/store.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2003-10-22T13·29+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2003-10-22T13·29+0000
commitc4e7d324b826d1197a90bf7f4f4b593e406e1087 (patch)
tree982ea330d81c1889d73c931ace2158b106fd2da4 /src/libnix/store.cc
parent9d95aafe8ccf9d037dc97bb875bc62b919d8b123 (diff)
* Use writeFull().
Diffstat (limited to 'src/libnix/store.cc')
-rw-r--r--src/libnix/store.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/libnix/store.cc b/src/libnix/store.cc
index c40d9efbebcf..e32f403b6ca7 100644
--- a/src/libnix/store.cc
+++ b/src/libnix/store.cc
@@ -307,8 +307,7 @@ void addTextToStore(const Path & dstPath, const string & s)
         AutoCloseFD fd = open(dstPath.c_str(), O_CREAT | O_EXCL | O_WRONLY, 0666);
         if (fd == -1) throw SysError(format("creating store file `%1%'") % dstPath);
 
-        if (write(fd, s.c_str(), s.size()) != (ssize_t) s.size())
-            throw SysError(format("writing store file `%1%'") % dstPath);
+        writeFull(fd, (unsigned char *) s.c_str(), s.size());
 
         Transaction txn(nixDB);
         registerValidPath(txn, dstPath);