summaryrefslogtreecommitdiffstats
path: root/Source/kwsys/testProcess.c
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2006-12-04 19:42:47 (GMT)
committerBrad King <brad.king@kitware.com>2006-12-04 19:42:47 (GMT)
commitde8ffcaef492e23af57ed5489dd8a21fdd7ad5d8 (patch)
tree90e99368258b6a9b7d0cf1770c78a1dcd174b82e /Source/kwsys/testProcess.c
parentd045ae45f2e45ca538269aadbab5e7dd6511186a (diff)
downloadCMake-de8ffcaef492e23af57ed5489dd8a21fdd7ad5d8.zip
CMake-de8ffcaef492e23af57ed5489dd8a21fdd7ad5d8.tar.gz
CMake-de8ffcaef492e23af57ed5489dd8a21fdd7ad5d8.tar.bz2
ENH: Changes based on patch from Ryan C. Gordon to enable process execution on BeOS. There seems to be no way to implement it without polling (or threads).
Diffstat (limited to 'Source/kwsys/testProcess.c')
-rw-r--r--Source/kwsys/testProcess.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/Source/kwsys/testProcess.c b/Source/kwsys/testProcess.c
index e9fc224..8ca56ed 100644
--- a/Source/kwsys/testProcess.c
+++ b/Source/kwsys/testProcess.c
@@ -34,6 +34,17 @@
# pragma warn -8060 /* possibly incorrect assignment */
#endif
+#if defined(__BEOS__) && !defined(__ZETA__)
+/* BeOS 5 doesn't have usleep(), but it has snooze(), which is identical. */
+# include <be/kernel/OS.h>
+static inline void testProcess_usleep(unsigned int msec)
+{
+ snooze(msec);
+}
+#else
+# define testProcess_usleep usleep
+#endif
+
int runChild(const char* cmd[], int state, int exception, int value,
int share, int output, int delay, double timeout, int poll,
int repeat, int disown);
@@ -76,6 +87,9 @@ int test4(int argc, const char* argv[])
#if defined(_WIN32)
/* Avoid error diagnostic popups since we are crashing on purpose. */
SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX);
+#elif defined(__BEOS__)
+ /* Avoid error diagnostic popups since we are crashing on purpose. */
+ disable_debugger(1);
#endif
(void)argc; (void)argv;
fprintf(stdout, "Output before crash on stdout from crash test.\n");
@@ -264,7 +278,7 @@ int runChild2(kwsysProcess* kp,
#if defined(_WIN32)
Sleep(100);
#else
- usleep(100000);
+ testProcess_usleep(100000);
#endif
}
if(delay)