mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 18:08:10 +00:00
use LYXERR macro to avoid unneeded argument evaluations...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21835 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
0c9dedfe01
commit
0e40512c86
@ -249,12 +249,12 @@ static bool rmdir(QFileInfo const & fi)
|
||||
bool success;
|
||||
if (list.at(i).isDir()) {
|
||||
LYXERR(Debug::FILES, "Erasing dir "
|
||||
<< fromqstr(list.at(i).absoluteFilePath()) << endl);
|
||||
<< fromqstr(list.at(i).absoluteFilePath()));
|
||||
success = rmdir(list.at(i));
|
||||
}
|
||||
else {
|
||||
LYXERR(Debug::FILES, "Erasing file "
|
||||
<< fromqstr(list.at(i).absoluteFilePath()) << endl);
|
||||
<< fromqstr(list.at(i).absoluteFilePath()));
|
||||
success = dir.remove(list.at(i).fileName());
|
||||
}
|
||||
if (!success) {
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include <boost/crc.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <iomanip>
|
||||
|
||||
using std::endl;
|
||||
using std::string;
|
||||
|
@ -50,7 +50,6 @@ int accept(int)
|
||||
|
||||
#include <cerrno>
|
||||
|
||||
using std::endl;
|
||||
using std::string;
|
||||
|
||||
#ifndef CXX_GLOBAL_CSTD
|
||||
@ -82,8 +81,7 @@ int listen(FileName const & name, int queue)
|
||||
string::size_type len = localname.size();
|
||||
// the field sun_path in sockaddr_un is a char[108]
|
||||
if (len > 107) {
|
||||
lyxerr << "lyx: Socket address '" << name.absFilename() << "' too long."
|
||||
<< endl;
|
||||
LYXERR(Debug::ANY, "lyx: Socket address '" << name.absFilename() << "' too long.");
|
||||
return -1;
|
||||
}
|
||||
// Synonims for AF_UNIX are AF_LOCAL and AF_FILE
|
||||
@ -96,15 +94,15 @@ int listen(FileName const & name, int queue)
|
||||
// For local sockets, the protocol is always 0
|
||||
// socket() returns -1 in case of error
|
||||
if ((fd = ::socket(PF_UNIX, SOCK_STREAM, 0))== -1) {
|
||||
lyxerr << "lyx: Could not create socket descriptor: "
|
||||
<< strerror(errno) << endl;
|
||||
LYXERR(Debug::ANY, "lyx: Could not create socket descriptor: "
|
||||
<< strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Set NONBLOCK mode for the file descriptor
|
||||
if (::fcntl(fd, F_SETFL, O_NONBLOCK) == -1) {
|
||||
lyxerr << "lyx: Could not set NONBLOCK mode for socket descriptor: "
|
||||
<< strerror(errno) << endl;
|
||||
LYXERR(Debug::ANY, "lyx: Could not set NONBLOCK mode for socket descriptor: "
|
||||
<< strerror(errno));
|
||||
::close(fd);
|
||||
return -1;
|
||||
}
|
||||
@ -113,8 +111,8 @@ int listen(FileName const & name, int queue)
|
||||
// the socket special file in the filesystem. bind() returns -1
|
||||
// in case of error
|
||||
if ((::bind (fd, reinterpret_cast<sockaddr *>(&addr), SUN_LEN(&addr))) == -1) {
|
||||
lyxerr << "lyx: Could not bind address '" << name.absFilename()
|
||||
<< "' to socket descriptor: " << strerror(errno) << endl;
|
||||
LYXERR(Debug::ANY, "lyx: Could not bind address '" << name.absFilename()
|
||||
<< "' to socket descriptor: " << strerror(errno));
|
||||
::close(fd);
|
||||
unlink(name);
|
||||
return -1;
|
||||
@ -126,8 +124,8 @@ int listen(FileName const & name, int queue)
|
||||
// It is not a restriction on the number of connections the socket
|
||||
// can accept. Returns -1 in case of error
|
||||
if (::listen (fd, queue) == -1) {
|
||||
lyxerr << "lyx: Could not put socket in 'listen' state: "
|
||||
<< strerror(errno) << endl;
|
||||
LYXERR(Debug::ANY, "lyx: Could not put socket in 'listen' state: "
|
||||
<< strerror(errno));
|
||||
::close(fd);
|
||||
unlink(name);
|
||||
return -1;
|
||||
@ -146,15 +144,15 @@ int accept(int sd)
|
||||
// Using null pointers for the second and third arguments
|
||||
// dismiss all information about the connecting client
|
||||
if ((fd = accept(sd, reinterpret_cast<sockaddr *>(0), reinterpret_cast<socklen_t *>(0))) == -1) {
|
||||
lyxerr << "lyx: Could not accept connection: "
|
||||
<< strerror(errno) << endl;
|
||||
LYXERR(Debug::ANY, "lyx: Could not accept connection: "
|
||||
<< strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Sets NONBLOCK mode for the file descriptor
|
||||
if (::fcntl(fd, F_SETFL, O_NONBLOCK) == -1) {
|
||||
lyxerr << "lyx: Could not set NONBLOCK mode for connection: "
|
||||
<< strerror(errno) << endl;
|
||||
LYXERR(Debug::ANY, "lyx: Could not set NONBLOCK mode for connection: "
|
||||
<< strerror(errno));
|
||||
::close(fd);
|
||||
return -1;
|
||||
}
|
||||
|
@ -46,7 +46,6 @@ extern "C" int mkstemp(char *);
|
||||
using boost::scoped_array;
|
||||
|
||||
using std::string;
|
||||
using std::endl;
|
||||
|
||||
namespace lyx {
|
||||
namespace support {
|
||||
@ -84,10 +83,9 @@ int make_tempfile(char * templ)
|
||||
|
||||
FileName const tempName(FileName const & dir, string const & mask)
|
||||
{
|
||||
string const tmpdir(dir.empty() ?
|
||||
package().temp_dir().absFilename() :
|
||||
dir.absFilename());
|
||||
string tmpfl(to_filesystem8bit(from_utf8(addName(tmpdir, mask))));
|
||||
string const tmpdir = dir.empty()
|
||||
? package().temp_dir().absFilename() : dir.absFilename();
|
||||
string tmpfl = to_filesystem8bit(from_utf8(addName(tmpdir, mask)));
|
||||
#if defined (HAVE_GETPID)
|
||||
tmpfl += convert<string>(getpid());
|
||||
#elif defined (HAVE__GETPID)
|
||||
|
@ -22,6 +22,7 @@
|
||||
|
||||
#include <cerrno>
|
||||
#include <iomanip>
|
||||
#include <ostream>
|
||||
#include <map>
|
||||
|
||||
using std::endl;
|
||||
@ -162,7 +163,7 @@ int IconvProcessor::convert(char const * buf, size_t buflen,
|
||||
// something like 0xffffffc2
|
||||
boost::uint32_t const b =
|
||||
*reinterpret_cast<unsigned char const *>(buf + i);
|
||||
lyxerr << " 0x" << b;
|
||||
lyxerr << " 0x" << (unsigned int)b;
|
||||
}
|
||||
lyxerr << std::dec << endl;
|
||||
break;
|
||||
@ -177,7 +178,7 @@ int IconvProcessor::convert(char const * buf, size_t buflen,
|
||||
// something like 0xffffffc2
|
||||
boost::uint32_t const b =
|
||||
*reinterpret_cast<unsigned char const *>(buf + i);
|
||||
lyxerr << " 0x" << b;
|
||||
lyxerr << " 0x" << (unsigned int)b;
|
||||
}
|
||||
lyxerr << std::dec << endl;
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user