1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-06-30 19:12:48 -05:00

Add cmake check for whether setpgrp takes arguments.

FreeBSD declares setpgrp() as taking two arguments, like Linux's
setpgid(). Detect that at configure time and adjust the call in
Pageant appropriately.
This commit is contained in:
Simon Tatham
2022-09-18 15:08:31 +01:00
parent 732ec31a17
commit fda41e1990
3 changed files with 21 additions and 0 deletions

View File

@ -330,7 +330,11 @@ void pageant_fork_and_print_env(bool retain_tty)
/* Get out of our previous process group, to avoid being
* blasted by passing signals. But keep our controlling tty,
* so we can keep checking to see if we still have one. */
#if defined HAVE_NULLARY_SETPGRP
setpgrp();
#elif defined HAVE_BINARY_SETPGRP
setpgrp(0, 0);
#endif
} else {
/* Do that, but also leave our entire session and detach from
* the controlling tty (if any). */