From f1e7481b8690a6ef71a83853f05645cb774778ab Mon Sep 17 00:00:00 2001 From: Stephane Chazelas Date: Sun, 18 Feb 2024 18:52:50 +0000 Subject: 45837: fix process group restoration upon exit --- Src/options.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Src/options.c') diff --git a/Src/options.c b/Src/options.c index a994b563e..a0e1aa024 100644 --- a/Src/options.c +++ b/Src/options.c @@ -881,11 +881,12 @@ dosetopt(int optno, int value, int force, char *new_opts) } else if (!force && optno == MONITOR && value) { if (new_opts[optno] == value) return 0; - if (SHTTY != -1) { + if (SHTTY == -1) + return -1; + if (!origpgrp) { origpgrp = GETPGRP(); acquire_pgrp(); - } else - return -1; + } #else } else if(optno == MONITOR && value) { return -1; -- cgit 1.4.1