diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2012-08-22T14·58-0400 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2012-08-22T14·58-0400 |
commit | 4aa1e5c55484ac02d28883292ee5c5806f5e4664 (patch) | |
tree | 880b2e66fef33411e35813ec5f00e39f9c88b2df /src/nix-worker | |
parent | d950cfe70b2b70e938ece672dbccedfd4413c295 (diff) |
Receive reserveSpace before calling startWork()
Otherwise we can get a SIGPOLL. Reported by Ludovic.
Diffstat (limited to 'src/nix-worker')
-rw-r--r-- | src/nix-worker/nix-worker.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nix-worker/nix-worker.cc b/src/nix-worker/nix-worker.cc index 80c0d50609c7..7099eb9eeb0d 100644 --- a/src/nix-worker/nix-worker.cc +++ b/src/nix-worker/nix-worker.cc @@ -619,6 +619,10 @@ static void processConnection() to.flush(); unsigned int clientVersion = readInt(from); + bool reserveSpace = true; + if (GET_PROTOCOL_MINOR(clientVersion) >= 11) + reserveSpace = readInt(from) != 0; + /* Send startup error messages to the client. */ startWork(); @@ -634,10 +638,6 @@ static void processConnection() throw Error("if you run `nix-worker' as root, then you MUST set `build-users-group'!"); #endif - bool reserveSpace = true; - if (GET_PROTOCOL_MINOR(clientVersion) >= 11) - reserveSpace = readInt(from) != 0; - /* Open the store. */ store = boost::shared_ptr<StoreAPI>(new LocalStore(reserveSpace)); |