]> git.lyx.org Git - lyx.git/blobdiff - src/lyxsocket.C
cleanup some debug messages
[lyx.git] / src / lyxsocket.C
index bad14b65d195cd475c2b305846b26311f558a120..bade99cb65d34267409c7c9fadc1fd9ed6671067 100644 (file)
@@ -12,6 +12,8 @@
  * Full author contact details are available in file CREDITS.
  */
 
+#include <config.h>
+
 #include "lyxsocket.h"
 
 #include "debug.h"
@@ -21,6 +23,7 @@
 
 #include "frontends/lyx_gui.h"
 
+#include "support/environment.h"
 #include "support/lyxlib.h"
 #include "support/socktools.h"
 
 
 #include <cerrno>
 
+#if defined (_WIN32)
+# include <io.h>
+#endif
+
 using boost::shared_ptr;
 
 using std::auto_ptr;
@@ -50,13 +57,13 @@ LyXServerSocket::LyXServerSocket(LyXFunc * f, string const & addr)
 
        // These env vars are used by DVI inverse search
        // Needed by xdvi
-       lyx::support::putenv("XEDITOR", "lyxclient -g %f %l");
+       lyx::support::setEnv("XEDITOR", "lyxclient -g %f %l");
        // Needed by lyxclient
-       lyx::support::putenv("LYXSOCKET", address_);
+       lyx::support::setEnv("LYXSOCKET", address_);
 
        lyx_gui::register_socket_callback(
                fd_,
-               boost::bind(&LyXServerSocket::serverCallback, *this)
+               boost::bind(&LyXServerSocket::serverCallback, this)
                );
 
        lyxerr[Debug::LYXSERVER] << "lyx: New server socket "
@@ -103,7 +110,7 @@ void LyXServerSocket::serverCallback()
        lyx_gui::register_socket_callback(
                client_fd,
                boost::bind(&LyXServerSocket::dataCallback,
-                           *this, client_fd)
+                           this, client_fd)
                );
 }
 
@@ -156,7 +163,7 @@ void LyXServerSocket::writeln(string const & line)
        string const linen(line + '\n');
        int const size = linen.size();
        int const written = ::write(fd_, linen.c_str(), size);
-       if (written < size) { // Allways mean end of connection.
+       if (written < size) { // Always mean end of connection.
                if ((written == -1) && (errno == EPIPE)) {
                        // The program will also receive a SIGPIPE
                        // that must be caught
@@ -251,7 +258,7 @@ void LyXDataSocket::writeln(string const & line)
        string const linen(line + '\n');
        int const size = linen.size();
        int const written = ::write(fd_, linen.c_str(), size);
-       if (written < size) { // Allways mean end of connection.
+       if (written < size) { // Always mean end of connection.
                if ((written == -1) && (errno == EPIPE)) {
                        // The program will also receive a SIGPIPE
                        // that must be catched