cosmetics

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21885 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2007-11-30 22:02:33 +00:00
parent 5c4a20fe04
commit 23a672cf26
2 changed files with 13 additions and 21 deletions

View File

@ -172,7 +172,7 @@ void LyXComm::closeConnection()
} }
if (!ready_) { if (!ready_) {
lyxerr << "LyXComm: Already disconnected" << endl; LYXERR0("LyXComm: Already disconnected");
return; return;
} }
@ -286,10 +286,9 @@ void LyXComm::read_ready()
return; return;
} }
if (errno != 0) { if (errno != 0) {
lyxerr << "LyXComm: " << strerror(errno) << endl; LYXERR0("LyXComm: " << strerror(errno));
if (!read_buffer_.empty()) { if (!read_buffer_.empty()) {
lyxerr << "LyXComm: truncated command: " LYXERR0("LyXComm: truncated command: " << read_buffer_);
<< read_buffer_ << endl;
read_buffer_.erase(); read_buffer_.erase();
} }
break; // reset connection break; // reset connection
@ -307,8 +306,7 @@ void LyXComm::read_ready()
void LyXComm::send(string const & msg) void LyXComm::send(string const & msg)
{ {
if (msg.empty()) { if (msg.empty()) {
lyxerr << "LyXComm: Request to send empty string. Ignoring." LYXERR0("LyXComm: Request to send empty string. Ignoring.");
<< endl;
return; return;
} }
@ -317,8 +315,7 @@ void LyXComm::send(string const & msg)
if (pipename_.empty()) return; if (pipename_.empty()) return;
if (!ready_) { if (!ready_) {
lyxerr << "LyXComm: Pipes are closed. Could not send " LYXERR0("LyXComm: Pipes are closed. Could not send " << msg);
<< msg << endl;
} else if (::write(outfd_, msg.c_str(), msg.length()) < 0) { } else if (::write(outfd_, msg.c_str(), msg.length()) < 0) {
lyxerr << "LyXComm: Error sending message: " << msg lyxerr << "LyXComm: Error sending message: " << msg
<< '\n' << strerror(errno) << '\n' << strerror(errno)
@ -372,6 +369,13 @@ Server::~Server()
} }
int compare(char const * a, char const * b, unsigned int len)
{
using namespace std;
return strncmp(a, b, len);
}
// Handle data gotten from communication, called by LyXComm // Handle data gotten from communication, called by LyXComm
void Server::callback(string const & msg) void Server::callback(string const & msg)
{ {
@ -459,8 +463,7 @@ void Server::callback(string const & msg)
"Server: ignoring bye messge from unregistered client" << client); "Server: ignoring bye messge from unregistered client" << client);
} }
} else { } else {
lyxerr <<"Server: Undefined server command " LYXERR0("Server: Undefined server command " << cmd << '.');
<< cmd << '.' << endl;
} }
return; return;
} }

View File

@ -47,17 +47,6 @@ int compare(char const * a, char const * b)
#endif #endif
} }
///
inline
int compare(char const * a, char const * b, unsigned int len)
{
#ifndef CXX_GLOBAL_CSTD
return std::strncmp(a, b, len);
#else
return strncmp(a, b, len);
#endif
}
/// ///
bool isStrInt(std::string const & str); bool isStrInt(std::string const & str);