summaryrefslogtreecommitdiff
path: root/mac
diff options
context:
space:
mode:
authorAndrew Choi <akochoi@shaw.ca>2001-09-04 06:12:57 +0000
committerAndrew Choi <akochoi@shaw.ca>2001-09-04 06:12:57 +0000
commitf44a40f2d2293e67bbdb7eba8e894ac9bffc952b (patch)
treeccfda392b663f760840d6fc2a943a3e01d956634 /mac
parent7e4db3bf65145e70e4fb5a4c934357c918e71427 (diff)
downloademacs-f44a40f2d2293e67bbdb7eba8e894ac9bffc952b.tar.gz
2001-09-04 Andrew Choi <akochoi@cse.cuhk.edu.hk>
* src/mac.c (sleep) [__MRC__]: Place loop around WaitNextEvent to check time elapsed instead of use WaitNextEvent call as a delay.
Diffstat (limited to 'mac')
-rw-r--r--mac/ChangeLog4
-rw-r--r--mac/src/mac.c8
2 files changed, 10 insertions, 2 deletions
diff --git a/mac/ChangeLog b/mac/ChangeLog
index fd259a54609..1ae1c7fdca8 100644
--- a/mac/ChangeLog
+++ b/mac/ChangeLog
@@ -9,7 +9,9 @@
* src/mac.c (stat): Don't fail for aliases.
(sys_open) [__MRC__]: Set file creator and type for newly-created
files.
-
+ (sleep) [__MRC__]: Place loop around WaitNextEvent to check time
+ elapsed instead of use WaitNextEvent call as a delay.
+
2001-08-24 Andrew Choi <akochoi@cse.cuhk.edu.hk>
* src/macterm.c (init_font_name_table): Add an additional entry to
diff --git a/mac/src/mac.c b/mac/src/mac.c
index 0aaad884f6d..d0c9d1a36c3 100644
--- a/mac/src/mac.c
+++ b/mac/src/mac.c
@@ -969,9 +969,15 @@ gettimeofday (tp)
unsigned int
sleep (unsigned int seconds)
{
+ unsigned long time_up;
EventRecord e;
- WaitNextEvent (0, &e, seconds * 60UL, NULL); /* Accept no event; just wait. by T.I.*/
+ time_up = TickCount () + seconds * 60;
+ while (TickCount () < time_up)
+ {
+ /* Accept no event; just wait. by T.I. */
+ WaitNextEvent (0, &e, 30, NULL);
+ }
return (0);
}