forgot the actual patch, oops

This commit is contained in:
prockai 2006-10-10 18:37:26 +00:00
parent 468a0ae166
commit c481edbf9e
2 changed files with 30 additions and 1 deletions

View File

@ -0,0 +1,29 @@
--- gpm-1.20.1/src/console.c.org 2006-09-03 10:11:17.000000000 +0200
+++ gpm-1.20.1/src/console.c 2006-09-03 10:14:34.000000000 +0200
@@ -30,6 +30,7 @@
#include <time.h> /* time() */
#include <sys/fcntl.h> /* O_RDONLY */
#include <sys/stat.h> /* mkdir() */
+#include <sys/time.h>
#include <asm/types.h> /* __u32 */
#include <linux/vt.h> /* VT_GETSTATE */
@@ -102,8 +103,17 @@ int is_text_console(void)
/*-------------------------------------------------------------------*/
void wait_text_console(void)
{
+ struct timeval now;
+ int usecs;
do {
- sleep(2);
+ /* sleep to the top of the seconds about 2 seconds from now */
+ gettimeofday(&now, NULL);
+ usecs = 2000000;
+ if (now.tv_usec <= 250000)
+ usecs -= 1000000;
+ usecs += 1000000 - now.tv_usec;
+
+ usleep(usecs);
} while (!is_text_console());
}

View File

@ -184,7 +184,7 @@ fi
%changelog
* Tue Oct 10 2006 Petr Rockai <prockai@redhat.com> - 1.20-1-76
- align sleeps to tick boundary, should reduce cpu wakeups
on laptops, fixes #205064
on laptops, fixes #205064 (patch by Arjan van de Ven)
- disable gpm altogether in runlevel 5, it is probably not
worth the overhead considering it is barely used at all