getpgrp() tcgetpgrp() are unix specific: protect with #ifdef __unix__

This commit is contained in:
stefan schippers 2023-10-28 01:20:51 +02:00
parent 8b784d01d9
commit 8ac4c6030d
1 changed files with 2 additions and 0 deletions

View File

@ -96,10 +96,12 @@ int main(int argc, char **argv)
#endif #endif
argc = process_options(argc, argv); argc = process_options(argc, argv);
#ifdef __unix__
/* if invoked in background detach from console */ /* if invoked in background detach from console */
if(getpgrp() != tcgetpgrp(STDOUT_FILENO) && !cli_opt_no_readline) { if(getpgrp() != tcgetpgrp(STDOUT_FILENO) && !cli_opt_no_readline) {
cli_opt_detach = 1; cli_opt_detach = 1;
} }
#endif
my_strdup(_ALLOC_ID_, &xschem_executable, argv[0]); my_strdup(_ALLOC_ID_, &xschem_executable, argv[0]);
if(debug_var>=1 && !has_x) if(debug_var>=1 && !has_x)