mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-11 02:18:29 -04:00
SITL: avoid parent pid code on cygwin
this causes problems on windows
This commit is contained in:
parent
3666476bcb
commit
ccada2e9c2
@ -55,7 +55,9 @@ struct sitl_fdm {
|
|||||||
|
|
||||||
static int sitl_fd;
|
static int sitl_fd;
|
||||||
struct sockaddr_in rcout_addr;
|
struct sockaddr_in rcout_addr;
|
||||||
|
#ifndef __CYGWIN__
|
||||||
static pid_t parent_pid;
|
static pid_t parent_pid;
|
||||||
|
#endif
|
||||||
struct ADC_UDR2 UDR2;
|
struct ADC_UDR2 UDR2;
|
||||||
struct RC_ICR4 ICR4;
|
struct RC_ICR4 ICR4;
|
||||||
extern AP_TimerProcess timer_scheduler;
|
extern AP_TimerProcess timer_scheduler;
|
||||||
@ -221,10 +223,12 @@ static void timer_handler(int signum)
|
|||||||
|
|
||||||
cli();
|
cli();
|
||||||
|
|
||||||
|
#ifndef __CYGWIN__
|
||||||
/* make sure we die if our parent dies */
|
/* make sure we die if our parent dies */
|
||||||
if (kill(parent_pid, 0) != 0) {
|
if (kill(parent_pid, 0) != 0) {
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* check for packet from flight sim */
|
/* check for packet from flight sim */
|
||||||
sitl_fdm_input();
|
sitl_fdm_input();
|
||||||
@ -292,7 +296,9 @@ static void setup_timer(void)
|
|||||||
*/
|
*/
|
||||||
void sitl_setup(void)
|
void sitl_setup(void)
|
||||||
{
|
{
|
||||||
|
#ifndef __CYGWIN__
|
||||||
parent_pid = getppid();
|
parent_pid = getppid();
|
||||||
|
#endif
|
||||||
|
|
||||||
rcout_addr.sin_family = AF_INET;
|
rcout_addr.sin_family = AF_INET;
|
||||||
rcout_addr.sin_port = htons(RCOUT_PORT);
|
rcout_addr.sin_port = htons(RCOUT_PORT);
|
||||||
|
Loading…
Reference in New Issue
Block a user