summaryrefslogtreecommitdiffstats
path: root/Modules/timemodule.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-04-10 22:07:43 (GMT)
committerGuido van Rossum <guido@python.org>2001-04-10 22:07:43 (GMT)
commitbceccf5f43b51d166951ea97cff086c8828b745b (patch)
tree051a8711efadb0a2c114debc509946507e65469e /Modules/timemodule.c
parent13aa70679ef504a7517261d5c4a3a27ee9aa30c7 (diff)
downloadcpython-bceccf5f43b51d166951ea97cff086c8828b745b.zip
cpython-bceccf5f43b51d166951ea97cff086c8828b745b.tar.gz
cpython-bceccf5f43b51d166951ea97cff086c8828b745b.tar.bz2
Updated version of RISCOS support. SF patch 411213 by Dietmar Schwertberger
Diffstat (limited to 'Modules/timemodule.c')
-rw-r--r--Modules/timemodule.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/Modules/timemodule.c b/Modules/timemodule.c
index cfce06b..0c5c257 100644
--- a/Modules/timemodule.c
+++ b/Modules/timemodule.c
@@ -756,9 +756,7 @@ floatsleep(double secs)
#if defined(__WATCOMC__) && !defined(__QNX__)
/* XXX Can't interrupt this sleep */
Py_BEGIN_ALLOW_THREADS
-#ifndef RISCOS
delay((int)(secs * 1000 + 0.5)); /* delay() uses milliseconds */
-#endif
Py_END_ALLOW_THREADS
#else /* !__WATCOMC__ || __QNX__ */
#ifdef MSDOS
@@ -831,10 +829,20 @@ floatsleep(double secs)
Py_END_ALLOW_THREADS
}
#else /* !__BEOS__ */
+#ifdef RISCOS
+ if (secs <= 0.0)
+ return 0;
+ Py_BEGIN_ALLOW_THREADS
+ /* This sleep *CAN BE* interrupted. */
+ if ( sleep(secs) )
+ return -1;
+ Py_END_ALLOW_THREADS
+#else /* !RISCOS */
/* XXX Can't interrupt this sleep */
Py_BEGIN_ALLOW_THREADS
sleep((int)secs);
Py_END_ALLOW_THREADS
+#endif /* !RISCOS */
#endif /* !__BEOS__ */
#endif /* !PYOS_OS2 */
#endif /* !MS_WIN32 */