]> git.lyx.org Git - lyx.git/blobdiff - src/client/client.cpp
* ExternalSupport.cpp:
[lyx.git] / src / client / client.cpp
index 8d47e347aa21df77f6ee60d7ff0236428b1823c8..fd7cc6f469edba00090e16f9fe93839ea9960c95 100644 (file)
@@ -47,6 +47,9 @@
 // fcntl()
 #include <fcntl.h>
 
+// strerror()
+#include <string.h>
+
 #include <cerrno>
 #include <cstdio>
 #include <cstdlib>
@@ -62,6 +65,10 @@ using ::boost::scoped_ptr;
 
 namespace lyx {
 
+// Keep the linker happy on Windows
+void lyx_exit(int)
+{}
+
 namespace support {
 
 string itoa(unsigned int i)
@@ -94,7 +101,7 @@ FileNameList lyxSockets(string const & dir, string const & pid)
        for (; it != end; ++it) {
                if (!it->isDirectory())
                        continue;
-               string const tmpdir = it->absFilename();
+               string const tmpdir = it->absFileName();
                if (!contains(tmpdir, "lyx_tmpdir" + pid))
                        continue;
 
@@ -137,7 +144,7 @@ int connect(FileName const & name)
        if (::connect(fd,
                      reinterpret_cast<struct sockaddr *>(&addr),
                      sizeof(addr)) == -1) {
-               cerr << "lyxclient: Could not connect to socket " << name.absFilename()
+               cerr << "lyxclient: Could not connect to socket " << name.absFileName()
                     << ": " << strerror(errno) << endl;
                ::close(fd);
                return -1;
@@ -566,14 +573,14 @@ int main(int argc, char * argv[])
                        if (server->connected())
                                break;
                        lyxerr << "lyxclient: " << "Could not connect to "
-                            << addr->absFilename() << endl;
+                            << addr->absFileName() << endl;
                }
                if (addr == end) {
                        lyxerr << "lyxclient: No suitable server found."
                               << endl;
                        return EXIT_FAILURE;
                }
-               cerr << "lyxclient: " << "Connected to " << addr->absFilename() << endl;
+               cerr << "lyxclient: " << "Connected to " << addr->absFileName() << endl;
        }
 
        int const serverfd = server->fd();
@@ -621,6 +628,8 @@ int main(int argc, char * argv[])
                if (iowatch.isset(0)) {
                        string command;
                        getline(cin, command);
+                       if (command.empty())
+                               continue;
                        if (command == "BYE:") {
                                server->writeln("BYE:");
                                saidbye = true;