mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 05:16:21 +00:00
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
This commit is contained in:
parent
4a0b9802c4
commit
d897bc79b4
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user