Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 160351 Details for
Bug 231775
app-shells/bash-3.2 tty session leader (tcsetpgrp) race condition
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to fix the race condition (stop parent from stealing child session leader status)
chet_tty_pgrp.patch (text/plain), 1.58 KB, created by
Joe Peterson (RETIRED)
on 2008-07-14 15:54:18 UTC
(
hide
)
Description:
Patch to fix the race condition (stop parent from stealing child session leader status)
Filename:
MIME Type:
Creator:
Joe Peterson (RETIRED)
Created:
2008-07-14 15:54:18 UTC
Size:
1.58 KB
patch
obsolete
>*** jobs.c.20080704 2008-07-10 15:14:13.000000000 -0400 >--- jobs.c 2008-07-10 15:17:59.000000000 -0400 >*************** >*** 266,269 **** >--- 266,270 ---- > static void set_job_running __P((int)); > static void setjstatus __P((int)); >+ static int maybe_give_terminal_to __P((pid_t, pid_t, int)); > static void mark_all_jobs_as_dead __P((void)); > static void mark_dead_jobs_as_notified __P((int)); >*************** >*** 637,641 **** > */ > if (job_control && newjob->pgrp && (subshell_environment&SUBSHELL_ASYNC) == 0) >! give_terminal_to (newjob->pgrp, 0); > } > } >--- 638,642 ---- > */ > if (job_control && newjob->pgrp && (subshell_environment&SUBSHELL_ASYNC) == 0) >! maybe_give_terminal_to (shell_pgrp, newjob->pgrp, 0); > } > } >*************** >*** 3833,3836 **** >--- 3834,3863 ---- > } > >+ /* Give terminal to NPGRP iff it's currently owned by OPGRP. FLAGS are the >+ flags to pass to give_terminal_to(). */ >+ static int >+ maybe_give_terminal_to (opgrp, npgrp, flags) >+ pid_t opgrp, npgrp; >+ int flags; >+ { >+ int tpgrp; >+ >+ tpgrp = tcgetpgrp (shell_tty); >+ if (tpgrp == npgrp) >+ { >+ terminal_pgrp = npgrp; >+ return 0; >+ } >+ else if (tpgrp != opgrp) >+ { >+ #if defined (DEBUG) >+ internal_warning ("maybe_give_terminal_to: terminal pgrp == %d shell pgrp = %d", tpgrp, opgrp); >+ #endif >+ return -1; >+ } >+ else >+ return (give_terminal_to (npgrp, flags)); >+ } >+ > /* Clear out any jobs in the job array. This is intended to be used by > children of the shell, who should not have any job structures as baggage
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 231775
: 160351