]> git.lyx.org Git - lyx.git/blobdiff - src/lyxserver.C
Fix bug 2485 and crash on middle mouse paste on math
[lyx.git] / src / lyxserver.C
index 70696796e4f7cfd2c523298f82bd452a2f5b0652..9ee85b17c274ae7a67b4e4cb5672be1ac320d9cb 100644 (file)
@@ -75,13 +75,39 @@ using std::endl;
 using std::string;
 
 
-// provide an empty mkfifo() if we do not have one. This disables the
-// lyxserver.
-#ifndef HAVE_MKFIFO
-int mkfifo(char const * __path, mode_t __mode) {
-       return 0;
+#if !defined (HAVE_MKFIFO)
+// We provide a stub class that disables the lyxserver.
+
+void LyXComm::openConnection()
+{}
+
+
+void LyXComm::closeConnection()
+{}
+
+
+int LyXComm::startPipe(string const & filename, bool write)
+{
+       return -1;
 }
-#endif
+
+
+void LyXComm::endPipe(int & fd, string const & filename, bool write)
+{}
+
+
+void LyXComm::emergencyCleanup()
+{}
+
+void LyXComm::read_ready()
+{}
+
+
+void LyXComm::send(string const & msg)
+{}
+
+
+#else // defined (HAVE_MKFIFO)
 
 
 void LyXComm::openConnection()
@@ -166,7 +192,7 @@ int LyXComm::startPipe(string const & filename, bool write)
        }
 
        if (rc != NO_ERROR) {
-               errnum = TranslateOS2Error(rc);
+               errnum = translateOS2Error(rc);
                lyxerr <<"LyXComm: Could not create pipe " << filename
                       << strerror(errnum) << endl;
                return -1;
@@ -174,7 +200,7 @@ int LyXComm::startPipe(string const & filename, bool write)
        // Listen to it.
        rc = DosConnectNPipe(os2fd);
        if (rc != NO_ERROR && rc != ERROR_PIPE_NOT_CONNECTED) {
-               errnum = TranslateOS2Error(rc);
+               errnum = translateOS2Error(rc);
                lyxerr <<"LyXComm: Could not create pipe " << filename
                       << strerror(errnum) << endl;
                return -1;
@@ -230,7 +256,7 @@ void LyXComm::endPipe(int & fd, string const & filename, bool write)
 
        rc = DosDisConnectNPipe(fd);
        if (rc != NO_ERROR) {
-               errnum = TranslateOS2Error(rc);
+               errnum = translateOS2Error(rc);
                lyxerr << "LyXComm: Could not disconnect pipe " << filename
                       << '\n' << strerror(errnum) << endl;
                return;
@@ -348,13 +374,15 @@ void LyXComm::send(string const & msg)
        int errnum;
        rc = DosResetBuffer(outfd);     // To avoid synchronization problems.
        if (rc != NO_ERROR) {
-               errnum = TranslateOS2Error(rc);
+               errnum = translateOS2Error(rc);
                lyxerr << "LyXComm: Message could not be flushed: " << msg
                       << '\n' << strerror(errnum) << endl;
        }
 #endif
 }
 
+#endif // defined (HAVE_MKFIFO)
+
 
 string const LyXComm::inPipeName() const
 {