diff options
author | Thomas Osterried <thomas@osterried.de> | 2008-10-11 08:27:03 +0000 |
---|---|---|
committer | Thomas Osterried <thomas@osterried.de> | 2008-10-11 08:27:03 +0000 |
commit | 7a6b317d093b120c8aa38e9abb47d60b61b1fe1d (patch) | |
tree | cbe663f2e3847554b7696b1a194c8b23eb5dea49 /ax25ipd/ax25ipd.c | |
parent | bc56cf90127cca5c8713fe1f6f26134682dfe56b (diff) |
Support for unix98 ptys ("/dev/ptmx"). Thanks to dk2crn.
Diffstat (limited to 'ax25ipd/ax25ipd.c')
-rw-r--r-- | ax25ipd/ax25ipd.c | 11 |
1 files changed, 11 insertions, 0 deletions
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(); |