From d897bc79b42ffec2c6a053686e196821a00e4dfa Mon Sep 17 00:00:00 2001 From: Angus Leeming Date: Mon, 19 Aug 2002 08:53:54 +0000 Subject: [PATCH] Make it compile. Make it say hello. Make it say bye. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5020 a592a061-630c-0410-9148-cb99ea01b6c8 --- development/lyxserver/server_monitor.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/development/lyxserver/server_monitor.c b/development/lyxserver/server_monitor.c index 90b057c3ea..c1c00f1dc3 100644 --- a/development/lyxserver/server_monitor.c +++ b/development/lyxserver/server_monitor.c @@ -128,7 +128,7 @@ void io_cb(int fd, void *data) if (n>=0) s[n] = 0; fprintf(stderr, "monitor: Coming: %s\n", s); - if (compare(s, "LYXSRV:", 7) == 0) { + if (strncmp(s, "LYXSRV:", 7) == 0) { if (strstr(s, "bye")) { lyx_listen = 0; fprintf(stderr, "monitor: LyX has closed connection!\n"); @@ -175,7 +175,7 @@ void openpipe() fl_add_io_callback(pipeout, FL_READ, io_cb, 0); // greet LyX - sprintf(buf, "LYXSRV:%s:hello", clientname); + sprintf(buf, "LYXSRV:%s:hello\n", clientname); write(pipein, buf, strlen(buf)); free(pipename); } else @@ -193,16 +193,16 @@ void closepipe() } if (pipein>=0) { - close(pipein); - } - - if (pipeout>=0) { if (lyx_listen) { lyx_listen = 0; /* Say goodbye */ sprintf(buf, "LYXSRV:%s:bye\n", clientname); - write(pipeout, buf, strlen(buf)); + write(pipein, buf, strlen(buf)); } + close(pipein); + } + + if (pipeout>=0) { close(pipeout); fl_remove_io_callback(pipeout, FL_READ, io_cb); } -- 2.39.2