From 447089a5f699f085661287dec4b3d88219f67068 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 15 Jan 2004 20:23:55 +0000 Subject: * Catch SIGINT to terminate cleanly when the user tries to interrupt Nix. This is to prevent Berkeley DB from becoming wedged. Unfortunately it is not possible to throw C++ exceptions from a signal handler. In fact, you can't do much of anything except change variables of type `volatile sig_atomic_t'. So we set an interrupt flag in the signal handler and check it at various strategic locations in the code (by calling checkInterrupt()). Since this is unlikely to cover all cases (e.g., (semi-)infinite loops), sometimes SIGTERM may now be required to kill Nix. --- src/libstore/store.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libstore/store.cc') diff --git a/src/libstore/store.cc b/src/libstore/store.cc index c1d95ab8c5..4cd77796ea 100644 --- a/src/libstore/store.cc +++ b/src/libstore/store.cc @@ -133,7 +133,7 @@ void copyPath(const Path & src, const Path & dst) source.fd = fds[0]; restorePath(dst, source); _exit(0); - } catch (exception & e) { + } catch (exception & e) { cerr << "error: " << e.what() << endl; } _exit(1); -- cgit 1.4.1