]> git.lyx.org Git - lyx.git/blobdiff - src/sp_spell.C
re-enable mathrm toggling with C-m (was disabled by accident)
[lyx.git] / src / sp_spell.C
index 67c3af6e3d26974d3b162de40792f282bae8b7d8..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
 
 ///
@@ -425,6 +419,19 @@ void ISpell::initialize(BufferParams const & params, string const & lang)
 }
 
 
+/* 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;
@@ -531,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_;