From 7a6b317d093b120c8aa38e9abb47d60b61b1fe1d Mon Sep 17 00:00:00 2001 From: Thomas Osterried Date: Sat, 11 Oct 2008 08:27:03 +0000 Subject: Support for unix98 ptys ("/dev/ptmx"). Thanks to dk2crn. --- ax25ipd/ax25ipd.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'ax25ipd/ax25ipd.c') diff --git a/ax25ipd/ax25ipd.c b/ax25ipd/ax25ipd.c index d906724..2151238 100644 --- a/ax25ipd/ax25ipd.c +++ b/ax25ipd/ax25ipd.c @@ -144,6 +144,17 @@ int main(int argc, char **argv) } } + /* we need to close stdin, stdout, stderr: because otherwise + * scripting like ttyname=$(ax25ipd | tail -1) does not work + */ + if (!isatty(1)) { + fflush(stdout); + fflush(stderr); + close(0); + close(1); + close(2); + } + /* and let the games begin */ io_start(); -- cgit v1.2.3