From da15136aa7b8c12024d9178d1ba6b29037984a75 Mon Sep 17 00:00:00 2001 From: William Hubbs Date: Sat, 7 Mar 2009 10:39:00 -0600 Subject: [PATCH] only one espeakup daemon should be running This fixes a bug which would allow espeakup in debug mode to be run even if espeakup was already running as a daemon. --- espeakup.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/espeakup.c b/espeakup.c index 970409b..9f1ff05 100644 --- a/espeakup.c +++ b/espeakup.c @@ -96,12 +96,13 @@ int main(int argc, char **argv) /* process command line options */ process_cli(argc, argv); - if (!debug) { - if (espeakup_is_running()) { - printf("Espeakup is already running!\n"); - return 1; - } + /* Is the espeakup daemon running? */ + if (espeakup_is_running()) { + printf("Espeakup is already running!\n"); + return 1; + } + if (!debug) { /* become a daemon */ daemon(0, 1);