mirror of
https://github.com/linux-speakup/espeakup.git
synced 2026-08-22 15:44:17 +02:00
Create pid file when espeakup is really ready
This makes sure that we do not report that we are ready until everything is initialized.
This commit is contained in:
parent
d977243735
commit
c1ad891f2e
1 changed files with 9 additions and 7 deletions
16
espeakup.c
16
espeakup.c
|
|
@ -98,15 +98,9 @@ int main(int argc, char **argv)
|
|||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* If we are not in debug mode, daemonize and store the pid.
|
||||
*/
|
||||
/* Daemonize if we are not in debug mode. */
|
||||
if (!debug) {
|
||||
daemon(0, 1);
|
||||
if (create_pid_file() < 0) {
|
||||
perror("Unable to create pid file");
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -153,6 +147,14 @@ int main(int argc, char **argv)
|
|||
return 4;
|
||||
}
|
||||
|
||||
/* Store the pid */
|
||||
if (!debug && espeakup_mode == ESPEAKUP_MODE_SPEAKUP) {
|
||||
if (create_pid_file() < 0) {
|
||||
perror("Unable to create pid file");
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
||||
/* wait for the threads to shut down. */
|
||||
pthread_join(signal_thread_id, NULL);
|
||||
pthread_join(softsynth_thread_id, NULL);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue