summaryrefslogtreecommitdiffstats
path: root/ax25ipd/ax25ipd.c
diff options
context:
space:
mode:
Diffstat (limited to 'ax25ipd/ax25ipd.c')
-rw-r--r--ax25ipd/ax25ipd.c11
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();