From 48fa20dfe9ec096971f4d17f0d535535d086f02e Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Wed, 14 Nov 2001 12:00:51 +0000 Subject: [PATCH] avoid closing server in emergency exit if there is no server git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3028 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 11 ++++++++++- src/ColorHandler.C | 2 +- src/lyxrc.C | 2 -- src/lyxserver.C | 16 +++++++++++++--- 4 files changed, 24 insertions(+), 7 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 085c6d5616..8d2bc17967 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,6 +1,15 @@ 2001-11-14 Jean-Marc Lasgouttes - * lyxrc.C (read): + * lyxserver.C (emergencyCleanup): do not try to close pipes if + server is not running. + (openConnection): + (closeConnection): add debug info when server is disabled. + + * ColorHandler.C (getGCForeground): send debug message to GUI + channel. + + * lyxrc.C: do not include lyxserver.h and tex-strings.h. + * kbmap.C (bind): modify because return conventions of kb_sequence::parse have changed. diff --git a/src/ColorHandler.C b/src/ColorHandler.C index fcd516610e..95912c5225 100644 --- a/src/ColorHandler.C +++ b/src/ColorHandler.C @@ -88,7 +88,7 @@ GC LyXColorHandler::getGCForeground(LColor::color c) val.foreground = bla; // Try the exact RGB values first, then the approximate. } else if (XAllocColor(display, colormap, &xcol) != 0) { - if (lyxerr.debugging()) { + if (lyxerr.debugging(Debug::GUI)) { lyxerr << _("LyX: X11 color ") << s << _(" allocated for ") << lcolor.getGUIName(c) << endl; diff --git a/src/lyxrc.C b/src/lyxrc.C index c93b33729a..cd89f42206 100644 --- a/src/lyxrc.C +++ b/src/lyxrc.C @@ -23,10 +23,8 @@ #include "lyxrc.h" #include "kbmap.h" #include "LyXAction.h" -#include "lyxserver.h" #include "lyx_main.h" #include "intl.h" -#include "tex-strings.h" #include "support/path.h" #include "support/filetools.h" #include "lyxtext.h" diff --git a/src/lyxserver.C b/src/lyxserver.C index 3e16f06138..368e6df9ad 100644 --- a/src/lyxserver.C +++ b/src/lyxserver.C @@ -108,7 +108,12 @@ void LyXComm::openConnection() // We assume that we don't make it ready = false; - if (pipename.empty()) return; + if (pipename.empty()) { + lyxerr[Debug::LYXSERVER] + << "LyXComm: server is disabled, nothing to do" + << endl; + return; + } if ((infd = startPipe(inPipeName(), false)) == -1) return; @@ -136,6 +141,9 @@ void LyXComm::closeConnection() lyxerr[Debug::LYXSERVER] << "LyXComm: Closing connection" << endl; if (pipename.empty()) { + lyxerr[Debug::LYXSERVER] + << "LyXComm: server is disabled, nothing to do" + << endl; return; } @@ -255,8 +263,10 @@ void LyXComm::endPipe(int & fd, string const & filename) void LyXComm::emergencyCleanup() { - endPipe(infd, inPipeName()); - endPipe(outfd, outPipeName()); + if (!pipename.empty()) { + endPipe(infd, inPipeName()); + endPipe(outfd, outPipeName()); + } } -- 2.39.2