diff options
author | Jade Lovelace <lix@jade.fyi> | 2024-08-01 13:42:14 -0700 |
---|---|---|
committer | Jade Lovelace <lix@jade.fyi> | 2024-08-04 20:55:45 -0700 |
commit | ca9d3e6e00ec452701d9d3b7e909eff61799f739 (patch) | |
tree | c56d28840835fabdfd70589a45a0ecf1a7accf80 /src/libstore/filetransfer.cc | |
parent | 9238e62ae6b7b8bf00d53b48e0c3ae33285dd4ab (diff) |
tree-wide: fix various lint warnings
Change-Id: I0fc80718eb7e02d84cc4b5d5deec4c0f41116134
Diffstat (limited to 'src/libstore/filetransfer.cc')
-rw-r--r-- | src/libstore/filetransfer.cc | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/libstore/filetransfer.cc b/src/libstore/filetransfer.cc index fcb947f96..566dc65d4 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); |