X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Flyxsocket.C;h=bade99cb65d34267409c7c9fadc1fd9ed6671067;hb=2486c96b8d9086471299bf207b85b1ce848246aa;hp=17c33165244964c46d53125c97468475ce69a6e2;hpb=835a0d91867e2cdd457930a9e64b9a1bfca39b23;p=lyx.git diff --git a/src/lyxsocket.C b/src/lyxsocket.C index 17c3316524..bade99cb65 100644 --- a/src/lyxsocket.C +++ b/src/lyxsocket.C @@ -12,6 +12,8 @@ * Full author contact details are available in file CREDITS. */ +#include + #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" @@ -28,6 +31,10 @@ #include +#if defined (_WIN32) +# include +#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