From ccada2e9c25ee9ba78b19a8ed2ab01bb3891737c Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 5 Mar 2012 21:04:26 +1100 Subject: [PATCH] SITL: avoid parent pid code on cygwin this causes problems on windows --- libraries/Desktop/support/sitl.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libraries/Desktop/support/sitl.cpp b/libraries/Desktop/support/sitl.cpp index 0671be6caf..4c279d26ef 100644 --- a/libraries/Desktop/support/sitl.cpp +++ b/libraries/Desktop/support/sitl.cpp @@ -55,7 +55,9 @@ struct sitl_fdm { static int sitl_fd; struct sockaddr_in rcout_addr; +#ifndef __CYGWIN__ static pid_t parent_pid; +#endif struct ADC_UDR2 UDR2; struct RC_ICR4 ICR4; extern AP_TimerProcess timer_scheduler; @@ -221,10 +223,12 @@ static void timer_handler(int signum) cli(); +#ifndef __CYGWIN__ /* make sure we die if our parent dies */ if (kill(parent_pid, 0) != 0) { exit(1); } +#endif /* check for packet from flight sim */ sitl_fdm_input(); @@ -292,7 +296,9 @@ static void setup_timer(void) */ void sitl_setup(void) { +#ifndef __CYGWIN__ parent_pid = getppid(); +#endif rcout_addr.sin_family = AF_INET; rcout_addr.sin_port = htons(RCOUT_PORT);