[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

mintlibs - sleep() patch



Hi,

below is a very important MagiC related patch to usleep(). Could somebody
with MagiC knowledge create similar patch for sleep()? The goal is to
remove the '_mint' reference, as usually. In the sleep() function there
are used signals and I don't know how completely are those implemented
in MagiC.

--- /usr/src/mintlib/pre48/lib/sleep.c	Wed Jan  7 01:15:12 1998
+++ sleep.c	Sun May  3 13:46:32 1998
@@ -135,13 +135,12 @@
 	unsigned long usec;
 {
 	unsigned long	stop;
-	extern int __mint;
+	int r = -EINVAL;

-	if (__mint) {
-		if (usec >= 1000)
-			(void)Fselect((unsigned)(usec/1000), 0L, 0L, 0L);
-	}
-	else {
+	if (usec >= 1000)
+		r = Fselect((unsigned)(usec/1000), 0L, 0L, 0L);
+
+	if (r == -EINVAL) {
 		stop = _clock() + USEC_TO_CLOCK_TICKS(usec);
 		while (_clock() < stop)
 			;

Petr
--
E-mail: stehlik@cas3.zlin.vutbr.cz                        PARCP developer
   WWW: http://cas3.zlin.vutbr.cz/~stehlik/              MiNTOS/Linux user
mirror: http://users.zln.cz/~pstehlik/                 Atari 800XL emulation
mirror: http://www.stehlik.cyberstrider.org/              Atari Falcon040