#include <boost/scoped_ptr.hpp>
// getpid(), getppid()
-#include <sys/types.h>
-#include <unistd.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
// select()
-#include <sys/select.h>
+#ifdef HAVE_SYS_SELECT_H
+# include <sys/select.h>
+#endif
// socket(), connect()
-#include <sys/socket.h>
+#ifdef HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#endif
#include <sys/un.h>
// fcntl()
<< ": " << strerror(errno) << endl;
::close(fd);
return -1;
- }
+ }
if (::fcntl(fd, F_SETFL, O_NONBLOCK) == -1) {
cerr << "lyxclient: Could not set O_NONBLOCK for socket: "
<< strerror(errno) << endl;
bool LyXDataSocket::readln(string & line)
{
int const charbuf_size = 100;
- char charbuf[charbuf_size]; // buffer for the ::read() system call
+ char charbuf[charbuf_size]; // buffer for the ::read() system call
int count;
string::size_type pos;