diff --git a/src/libstore/build.cc b/src/libstore/build.cc index ed53f48aa0..6d0498968d 100644 --- a/src/libstore/build.cc +++ b/src/libstore/build.cc @@ -12,6 +12,10 @@ #include #include +#ifdef __CYGWIN__ +#include +#endif + #include #include @@ -317,6 +321,13 @@ const char * * strings2CharPtrs(const Strings & ss) } +/* Hack for Cygwin: _exit() doesn't seem to work quite right, since + some Berkeley DB code appears to be called when a child exits + through _exit() (e.g., because execve() failed). So call the + Windows API directly. */ +#define _exit(n) ExitProcess(n) + + //////////////////////////////////////////////////////////////////////