From cb96dc107459303d36d9f761f943f4e0e7caf195 Mon Sep 17 00:00:00 2001 From: tumbili Date: Thu, 3 Sep 2015 09:54:10 +0200 Subject: [PATCH] do not close stdin/stdout for posix --- src/modules/sdlog2/sdlog2.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/modules/sdlog2/sdlog2.c b/src/modules/sdlog2/sdlog2.c index c6d13f8756..a81ab9fdb1 100644 --- a/src/modules/sdlog2/sdlog2.c +++ b/src/modules/sdlog2/sdlog2.c @@ -1272,13 +1272,16 @@ int sdlog2_thread_main(int argc, char *argv[]) subs.sat_info_sub = -1; - /* close non-needed fd's */ +#ifdef __PX4_NUTTX + /* close non-needed fd's. We cannot do this for posix since the file + descriptors will also be closed for the parent process + */ /* close stdin */ close(0); /* close stdout */ close(1); - +#endif /* initialize thread synchronization */ pthread_mutex_init(&logbuffer_mutex, NULL); pthread_cond_init(&logbuffer_cond, NULL);