mirror of
https://github.com/linux-speakup/espeakup.git
synced 2026-08-22 15:44:17 +02:00
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.
This commit is contained in:
parent
b2bd1d33a8
commit
58ed438f00
1 changed files with 15 additions and 13 deletions
28
espeakup.c
28
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue