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) {
#include <cerrno>
-using std::endl;
using std::string;
#ifndef CXX_GLOBAL_CSTD
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
// 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;
}
// 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;
// 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;
// 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;
}
using boost::scoped_array;
using std::string;
-using std::endl;
namespace lyx {
namespace support {
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)
#include <cerrno>
#include <iomanip>
+#include <ostream>
#include <map>
using std::endl;
// 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;
// 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;