about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2006-06-19T16·24+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2006-06-19T16·24+0000
commit5bb3444032ad92b98a4a58051fec1f2b31d2e3da (patch)
tree65585500647c485d52c81a9838ec683bb61e97f3 /src
parentb35735d8b28af206fa0b293c796bf44c62dde678 (diff)
* _exit() doesn't seem to work right on Cygwin.
Diffstat (limited to 'src')
-rw-r--r--src/libstore/build.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index ed53f48aa001..6d0498968d0d 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -12,6 +12,10 @@
 #include <unistd.h>
 #include <errno.h>
 
+#ifdef __CYGWIN__
+#include <windows.h>
+#endif
+
 #include <pwd.h>
 #include <grp.h>
 
@@ -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)
+
+
 
 //////////////////////////////////////////////////////////////////////