# HG changeset patch # User Andrew Choi # Date 999583977 0 # Node ID c563758063514fece3fbdbd086ae8b8a0f5e4e72 # Parent 6addcec799eb202313f38fe90e19e0e19bed0ac5 2001-09-04 Andrew Choi * src/mac.c (sleep) [__MRC__]: Place loop around WaitNextEvent to check time elapsed instead of use WaitNextEvent call as a delay. diff -r 6addcec799eb -r c56375806351 mac/ChangeLog --- a/mac/ChangeLog Tue Sep 04 05:45:39 2001 +0000 +++ b/mac/ChangeLog Tue Sep 04 06:12:57 2001 +0000 @@ -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 * src/macterm.c (init_font_name_table): Add an additional entry to diff -r 6addcec799eb -r c56375806351 mac/src/mac.c --- a/mac/src/mac.c Tue Sep 04 05:45:39 2001 +0000 +++ b/mac/src/mac.c Tue Sep 04 06:12:57 2001 +0000 @@ -969,9 +969,15 @@ 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); }