#pragma implementation
#endif
+#include <sys/types.h>
+#include <sys/wait.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdio.h>
pid_t isp_pid = -1;
}
-/// can be found in src/insets/figinset.C
-extern void sigchldchecker(pid_t pid, int * status);
-
///
// ------------------- start special pspell code/class --------------------
///
}
-void PSpell::sigchldhandler(pid_t pid, int * status)
-{
- sigchldchecker(pid, status);
-}
-
#endif
///
if (isp_pid == -1) {
error_ =
"\n\n"
- "The ispell-process has died for some reason. *One* possible reason\n"
- "could be that you do not have a dictionary file\n"
- "for the language of this document installed.\n"
- "Check /usr/lib/ispell or set another\n"
- "dictionary in the Spellchecker Options menu.";
+ "The spellcheck-process has died for some reason.\n"
+ "*One* possible reason could be that you do not have\n"
+ "a dictionary file for the language of this document\n"
+ "installed.\n"
+ "Check your spellchecker or set another dictionary\n"
+ "in the Spellchecker Options menu.\n\n";
} else {
error_ = 0;
}
}
+/* FIXME: this is a minimalist solution until the above
+ * code is able to work with forkedcall.h. We only need
+ * to reap the zombies here.
+ */
+void reapSpellchecker(void)
+{
+ if (isp_pid == -1)
+ return;
+
+ waitpid(isp_pid, 0, WNOHANG);
+}
+
+
bool ISpell::alive()
{
return isp_pid != -1;
}
-void ISpell::sigchldhandler(pid_t pid, int * status)
-{
- if (isp_pid > 0) {
- if (pid == isp_pid) {
- isp_pid = -1;
- // set the file descriptor to nonblocking so we can
- // continue
- fcntl(isp_fd, F_SETFL, O_NONBLOCK);
- }
- }
- sigchldchecker(pid, status);
-}
-
-
char const * ISpell::error()
{
return error_;