aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/filetransfer.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstore/filetransfer.cc')
-rw-r--r--src/libstore/filetransfer.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/libstore/filetransfer.cc b/src/libstore/filetransfer.cc
index fcb947f96..9cb805444 100644
--- a/src/libstore/filetransfer.cc
+++ b/src/libstore/filetransfer.cc
@@ -477,8 +477,17 @@ struct curlFileTransfer : public FileTransfer
~curlFileTransfer()
{
- stopWorkerThread();
-
+ try {
+ stopWorkerThread();
+ } catch (nix::Error & e) {
+ // This can only fail if a socket to our own process cannot be
+ // written to, so it is always a bug in the program if it fails.
+ //
+ // Joining the thread would probably only cause a deadlock if this
+ // happened, so just die on purpose.
+ printError("failed to join curl file transfer worker thread: %1%", e.what());
+ std::terminate();
+ }
workerThread.join();
if (curlm) curl_multi_cleanup(curlm);