From 58ed438f00c0f79c87885b73292c3b4e5c44e0d4 Mon Sep 17 00:00:00 2001 From: William Hubbs Date: Sat, 7 May 2011 10:35:57 -0500 Subject: [PATCH] rework two if statements These if statements were executing code if we were not in acsint mode. They have been combined and the code is now executed when we are in speakup mode, which is what we want. --- espeakup.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/espeakup.c b/espeakup.c index dff917c..9d1f06c 100644 --- a/espeakup.c +++ b/espeakup.c @@ -91,20 +91,22 @@ int main(int argc, char **argv) /* process command line options */ process_cli(argc, argv); - /* Is the espeakup daemon running? */ - if (espeakup_mode != ESPEAKUP_MODE_ACSINT && espeakup_is_running()) { - printf("Espeakup is already running!\n"); - return 1; - } + if (espeakup_mode == ESPEAKUP_MODE_SPEAKUP) { + /* Is the espeakup daemon running? */ + if (espeakup_is_running()) { + printf("Espeakup is already running!\n"); + return 1; + } -/* - * If we are not in debug mode, become a daemon and store the pid. - */ - if (espeakup_mode != ESPEAKUP_MODE_ACSINT && !debug) { - daemon(0, 1); - if (create_pid_file() < 0) { - perror("Unable to create pid file"); - return 2; + /* + * If we are not in debug mode, daemonize and store the pid. + */ + if (!debug) { + daemon(0, 1); + if (create_pid_file() < 0) { + perror("Unable to create pid file"); + return 2; + } } }