diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2006-12-04 17:55:14 +0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2006-12-04 17:55:14 +0000 |
commit | 40c3529909a929e03ebd943d87dd00e3fce93c9e (patch) | |
tree | 1b7fb41ce69c9884846f6e42d2c9e6944b2e7585 /src/libstore/remote-store.cc | |
parent | 0130ef88ea280e67037fa76bcedc59db17d9a8ca (diff) |
* Handle exceptions and stderr for all protocol functions.
* SIGIO -> SIGPOLL (POSIX calls it that).
* Use sigaction instead of signal to register the SIGPOLL handler.
Sigaction is better defined, and a handler registered with signal
appears not to interrupt fcntl(..., F_SETLKW, ...), which is bad.
Diffstat (limited to 'src/libstore/remote-store.cc')
-rw-r--r-- | src/libstore/remote-store.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc index b9ed1fdbc..483794bc8 100644 --- a/src/libstore/remote-store.cc +++ b/src/libstore/remote-store.cc @@ -147,6 +147,7 @@ bool RemoteStore::isValidPath(const Path & path) { writeInt(wopIsValidPath, to); writeString(path, to); + processStderr(); unsigned int reply = readInt(from); return reply != 0; } @@ -162,6 +163,7 @@ bool RemoteStore::hasSubstitutes(const Path & path) { writeInt(wopHasSubstitutes, to); writeString(path, to); + processStderr(); unsigned int reply = readInt(from); return reply != 0; } @@ -171,6 +173,7 @@ Hash RemoteStore::queryPathHash(const Path & path) { writeInt(wopQueryPathHash, to); writeString(path, to); + processStderr(); string hash = readString(from); return parseHash(htSHA256, hash); } @@ -181,6 +184,7 @@ void RemoteStore::queryReferences(const Path & path, { writeInt(wopQueryReferences, to); writeString(path, to); + processStderr(); PathSet references2 = readStringSet(from); references.insert(references2.begin(), references2.end()); } @@ -191,6 +195,7 @@ void RemoteStore::queryReferrers(const Path & path, { writeInt(wopQueryReferrers, to); writeString(path, to); + processStderr(); PathSet referrers2 = readStringSet(from); referrers.insert(referrers2.begin(), referrers2.end()); } @@ -207,6 +212,7 @@ Path RemoteStore::addToStore(const Path & _srcPath, bool fixed, writeInt(recursive ? 1 : 0, to); writeString(hashAlgo, to); dumpPath(srcPath, to); + processStderr(); Path path = readString(from); return path; } @@ -220,6 +226,7 @@ Path RemoteStore::addTextToStore(const string & suffix, const string & s, writeString(s, to); writeStringSet(references, to); + processStderr(); Path path = readString(from); return path; } @@ -238,6 +245,7 @@ void RemoteStore::ensurePath(const Path & path) { writeInt(wopEnsurePath, to); writeString(path, to); + processStderr(); readInt(from); } @@ -246,6 +254,7 @@ void RemoteStore::addTempRoot(const Path & path) { writeInt(wopAddTempRoot, to); writeString(path, to); + processStderr(); readInt(from); } @@ -253,6 +262,7 @@ void RemoteStore::addTempRoot(const Path & path) void RemoteStore::syncWithGC() { writeInt(wopSyncWithGC, to); + processStderr(); readInt(from); } |