Mercurial > pidgin
diff src/gtkspell.c @ 3105:da324fe688b3
[gaim-migrate @ 3119]
Jabber improvements (Jim Seymour) and good handling of sigchld (Jim Seymour and Luke Schierer)
committer: Tailor Script <tailor@pidgin.im>
| author | Sean Egan <seanegan@gmail.com> |
|---|---|
| date | Thu, 28 Mar 2002 20:07:45 +0000 |
| parents | 4c6ad3d9db3f |
| children | 0f8e4835d938 |
line wrap: on
line diff
--- a/src/gtkspell.c Thu Mar 28 19:58:58 2002 +0000 +++ b/src/gtkspell.c Thu Mar 28 20:07:45 2002 +0000 @@ -55,7 +55,18 @@ static void set_up_signal(); int gtkspell_running() { - return (spell_pid > 0); + return (spell_pid > 0? spell_pid : 0); +} + +/* + * Set to "gtkspell not running" status + * + * May seem a bit silly, but it allows us to keep the file-global + * variable from going program-global. And if we need to do + * something else additional later, well... + */ +void gtkspell_notrunning() { + spell_pid = 0; } /* @@ -170,11 +181,6 @@ gtkspell_stop(); } - if (!signal_set_up) { - set_up_signal(); - signal_set_up = 1; - } - pipe(fd_write); pipe(fd_read); pipe(fd_error); @@ -689,21 +695,3 @@ gtkspell_uncheck_all(gtktext); } -static void sigchld(int param) { - if (gtkspell_running() && - (waitpid(spell_pid, NULL, WNOHANG) == spell_pid)) { - spell_pid = 0; - } else { - /* a default SIGCHLD handler. - * what else to do here? */ - waitpid(-1, NULL, WNOHANG); - } -} - -static void set_up_signal() { - struct sigaction sigact; - memset(&sigact, 0, sizeof(struct sigaction)); - - sigact.sa_handler = sigchld; - sigaction(SIGCHLD, &sigact, NULL); -}
