diff options
| author | 2018-05-30 18:22:50 +0000 | |
|---|---|---|
| committer | 2018-05-30 18:22:50 +0000 | |
| commit | 6a084834f06a31ea6f15db27420a8240fe64f033 (patch) | |
| tree | ab44bfa717f1c51bac0b569bb6632298baf229cb | |
| parent | 5bb62fcb2e0e0e1a6d9b6f5523a20376b771bd75 (diff) | |
| parent | 93f30a99a159f0e46d9fd6e1def04b67aa2a0120 (diff) | |
Merge "Change sleep to nanosleep to avoid failures."
| -rw-r--r-- | test/137-cfi/cfi.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/test/137-cfi/cfi.cc b/test/137-cfi/cfi.cc index 49db0c82b5..7ada47d304 100644 --- a/test/137-cfi/cfi.cc +++ b/test/137-cfi/cfi.cc @@ -56,9 +56,12 @@ static void CauseSegfault() { extern "C" JNIEXPORT jboolean JNICALL Java_Main_sleep(JNIEnv*, jobject, jint, jboolean, jdouble) { // Keep pausing. + struct timespec ts = { .tv_sec = 100, .tv_nsec = 0 }; printf("Going to sleep\n"); for (;;) { - sleep(1); + // Use nanosleep since it gets to the system call quickly and doesn't + // have any points at which an unwind will fail. + nanosleep(&ts, nullptr); } } |