* fork.cc (fork): Move top-of-stack calculation later.
* pinfo.cc (_pinfo::set_ctty): Use __ctty to print current console in debugging output.
This commit is contained in:
parent
0f46c31745
commit
7912bcbf36
|
@ -1,3 +1,10 @@
|
|||
2005-11-17 Christopher Faylor <cgf@timesys.com>
|
||||
|
||||
* fork.cc (fork): Move top-of-stack calculation later.
|
||||
|
||||
* pinfo.cc (_pinfo::set_ctty): Use __ctty to print current console in
|
||||
debugging output.
|
||||
|
||||
2005-11-17 Corinna Vinschen <corinna@vinschen.de>
|
||||
|
||||
* fhandler_tty.cc (fhandler_tty_slave::open): Don't expect that
|
||||
|
|
|
@ -557,11 +557,8 @@ fork ()
|
|||
grouped.load_dlls = 0;
|
||||
|
||||
int res;
|
||||
void *esp;
|
||||
int ischild;
|
||||
|
||||
__asm__ volatile ("movl %%esp,%0": "=r" (esp));
|
||||
|
||||
myself->set_has_pgid_children ();
|
||||
|
||||
if (grouped.ch.parent == NULL)
|
||||
|
@ -574,6 +571,10 @@ fork ()
|
|||
|
||||
sig_send (NULL, __SIGHOLD);
|
||||
ischild = setjmp (grouped.ch.jmp);
|
||||
|
||||
void *esp;
|
||||
__asm__ volatile ("movl %%esp,%0": "=r" (esp));
|
||||
|
||||
if (!ischild)
|
||||
res = grouped.parent (esp);
|
||||
else
|
||||
|
|
|
@ -330,18 +330,18 @@ _pinfo::_ctty (char *buf)
|
|||
void
|
||||
_pinfo::set_ctty (tty_min *tc, int flags, fhandler_tty_slave *arch)
|
||||
{
|
||||
debug_printf ("checking if /dev/tty%d changed", ctty);
|
||||
debug_printf ("old %s", __ctty ());
|
||||
if ((ctty < 0 || ctty == tc->ntty) && !(flags & O_NOCTTY))
|
||||
{
|
||||
ctty = tc->ntty;
|
||||
syscall_printf ("attached tty%d sid %d, pid %d, tty->pgid %d, tty->sid %d",
|
||||
tc->ntty, sid, pid, pgid, tc->getsid ());
|
||||
syscall_printf ("attached %s sid %d, pid %d, tty->pgid %d, tty->sid %d",
|
||||
__ctty (), sid, pid, pgid, tc->getsid ());
|
||||
|
||||
pinfo p (tc->getsid ());
|
||||
if (sid == pid && (!p || p->pid == pid || !p->exists ()))
|
||||
{
|
||||
paranoid_printf ("resetting tty%d sid. Was %d, now %d. pgid was %d, now %d.",
|
||||
tc->ntty, tc->getsid (), sid, tc->getpgid (), pgid);
|
||||
paranoid_printf ("resetting %s sid. Was %d, now %d. pgid was %d, now %d.",
|
||||
__ctty (), tc->getsid (), sid, tc->getpgid (), pgid);
|
||||
/* We are the session leader */
|
||||
tc->setsid (sid);
|
||||
tc->setpgid (pgid);
|
||||
|
|
Loading…
Reference in New Issue