diff options
author | Tiago Vignatti <tiago.vignatti@nokia.com> | 2010-08-04 16:12:59 +0300 |
---|---|---|
committer | Tiago Vignatti <tiago.vignatti@nokia.com> | 2010-09-10 21:49:29 +0300 |
commit | 7d8cabd027cfc55e9921307e5b3dd7052de8496f (patch) | |
tree | 6ace6a14cf30886f6cae508dba3cbfefa6c15893 | |
parent | d9c18c3b9badf38d499e3f53291bd23fda3c4340 (diff) |
os: simplify smart scheduler init process
Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
-rw-r--r-- | include/dixstruct.h | 2 | ||||
-rw-r--r-- | os/osinit.c | 4 | ||||
-rw-r--r-- | os/utils.c | 9 |
3 files changed, 6 insertions, 9 deletions
diff --git a/include/dixstruct.h b/include/dixstruct.h index efa2577f8..8547b16ce 100644 --- a/include/dixstruct.h +++ b/include/dixstruct.h @@ -136,7 +136,7 @@ extern _X_EXPORT void SmartScheduleStopTimer(void); #define SMART_MAX_PRIORITY (20) #define SMART_MIN_PRIORITY (-20) -extern _X_EXPORT Bool SmartScheduleInit(void); +extern _X_EXPORT void SmartScheduleInit(void); /* This prototype is used pervasively in Xext, dix */ diff --git a/os/osinit.c b/os/osinit.c index de815c6cd..c83c32cf5 100644 --- a/os/osinit.c +++ b/os/osinit.c @@ -305,9 +305,7 @@ OsInit(void) * log file name if logging to a file is desired. */ LogInit(NULL, NULL); - if (!SmartScheduleDisable) - if (!SmartScheduleInit ()) - SmartScheduleDisable = TRUE; + SmartScheduleInit (); } void diff --git a/os/utils.c b/os/utils.c index cc942e954..8921d7c5f 100644 --- a/os/utils.c +++ b/os/utils.c @@ -1155,14 +1155,14 @@ SmartScheduleTimer (int sig) SmartScheduleTime += SmartScheduleInterval; } -Bool +void SmartScheduleInit (void) { struct sigaction act; if (SmartScheduleDisable) - return TRUE; - + return; + memset((char *) &act, 0, sizeof(struct sigaction)); /* Set up the timer signal function */ @@ -1172,9 +1172,8 @@ SmartScheduleInit (void) if (sigaction (SIGALRM, &act, 0) < 0) { perror ("sigaction for smart scheduler"); - return FALSE; + SmartScheduleDisable = TRUE; } - return TRUE; } #ifdef SIG_BLOCK |