Skip to content

Commit

Permalink
Allow compiling mce without enabling wakelock support
Browse files Browse the repository at this point in the history
All wakelock manipulation calls were not inside
  #ifdef ENABLE_WAKELOCKS ... #endif
blocks
  • Loading branch information
spiiroin committed Jan 11, 2013
1 parent 8569abe commit 2fbbb57
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mce.c
Expand Up @@ -255,8 +255,10 @@ static gint init_locales(const gchar *const name)

void mce_quit_mainloop(void)
{
#ifdef ENABLE_WAKELOCKS
/* We are on exit path -> block suspend for good */
wakelock_block_suspend_until_exit();
#endif

/* Exit immediately if there is no mainloop to terminate */
if( !mainloop ) {
Expand Down Expand Up @@ -433,7 +435,9 @@ static void mce_tx_signal_cb(int sig)
static volatile int exit_tries = 0;

static const char msg[] = "\n*** BREAK ***\n";
#ifdef ENABLE_WAKELOCKS
static const char die[] = "\n*** UNRECOVERABLE FAILURE ***\n";
#endif

/* FIXME: Should really use sigaction() to avoid having
* the default handler active until we manage to restore
Expand All @@ -449,8 +453,10 @@ static void mce_tx_signal_cb(int sig)
* not stop us from handling at least repeated terminating
signals ... */

#ifdef ENABLE_WAKELOCKS
/* We are on exit path -> block suspend for good */
wakelock_block_suspend_until_exit();
#endif

no_error_check_write(STDERR_FILENO, msg, sizeof msg - 1);

Expand Down

0 comments on commit 2fbbb57

Please sign in to comment.