]> git.lyx.org Git - lyx.git/blobdiff - src/sp_spell.C
get rid of LYX_LIBS
[lyx.git] / src / sp_spell.C
index ee9b546cd6cfe909506a6ac9a30cdc44e716b2de..3563c32cbe3aa96d642d80643bb56b3b29417d5e 100644 (file)
@@ -17,6 +17,8 @@
 #pragma implementation
 #endif
 
+#include <sys/types.h>
+#include <sys/wait.h>
 #include <unistd.h>
 #include <fcntl.h>
 #include <stdio.h>
@@ -58,9 +60,6 @@ namespace {
        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 --------------------
 ///
@@ -189,11 +188,6 @@ char const * PSpell::error()
 }
 
 
-void PSpell::sigchldhandler(pid_t pid, int * status)
-{
-       sigchldchecker(pid, status);
-}
-
 #endif
 
 ///
@@ -413,17 +407,31 @@ void ISpell::initialize(BufferParams const & params, string const & lang)
        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;
@@ -530,20 +538,6 @@ void ISpell::store(string const & mis, string const & cor)
 }
 
 
-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_;