From f6d25b8861f97439d7086e4569e209c46486d009 Mon Sep 17 00:00:00 2001 From: Fritz Elfert Date: Sun, 14 Jan 2001 22:28:37 +0000 Subject: - Added Hint for man pages in README. - Added signal handles for SIGINT and SIGTERM in ncpd for - properly shutting down the link. - Added flush() method in link.cc, needed for above feature. - If started with option -e and no -s option is given, assume being started by mgetty and use the line ncpd is started on instead of builtin default. - Added auto-reset in packet.cc. This helps making IrDA (ircomm-tty) based connections. Still not satisfying as i sometimes have to toggle infrared on the Psion (probably a bug in the Psion's IrDA). --- ncpd/link.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'ncpd/link.cc') diff --git a/ncpd/link.cc b/ncpd/link.cc index fac136b..f4f73e4 100644 --- a/ncpd/link.cc +++ b/ncpd/link.cc @@ -50,6 +50,7 @@ link::link(const char *fname, int baud, IOWatch & iow, unsigned short _verbose) link::~link() { + flush(); delete p; } @@ -61,7 +62,7 @@ reset() { somethingToSend = false; timesSent = 0; failed = false; -// p->reset(); + // p->reset(); } short int link:: @@ -216,6 +217,12 @@ poll() return ret; } +void link:: +flush() { + while ((!failed) && stuffToSend()) + poll(); +} + bool link:: stuffToSend() { -- cgit v1.2.3