]> git.lyx.org Git - lyx.git/blobdiff - src/lyxsocket.C
cleanup some debug messages
[lyx.git] / src / lyxsocket.C
index 17c33165244964c46d53125c97468475ce69a6e2..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,9 +57,9 @@ 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_,
@@ -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