Hurd: Fix possibly uninitialized variable in _hurd_locked_install_cttyid.
This commit is contained in:
parent
e70ffcb0fa
commit
e87e2f48ef
|
@ -1,3 +1,8 @@
|
||||||
|
2009-12-22 Samuel Thibault <samuel.thibault@ens-lyon.org>
|
||||||
|
|
||||||
|
* hurd/hurdioctl.c (_hurd_locked_install_cttyid): Set newctty to
|
||||||
|
MACH_PORT_NULL when id != cttyid.
|
||||||
|
|
||||||
2009-12-20 Samuel Thibault <samuel.thibault@ens-lyon.org>
|
2009-12-20 Samuel Thibault <samuel.thibault@ens-lyon.org>
|
||||||
|
|
||||||
* sysdeps/mach/hurd/getcwd.c (cleanup): Do not call
|
* sysdeps/mach/hurd/getcwd.c (cleanup): Do not call
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/* ioctl commands which must be done in the C library.
|
/* ioctl commands which must be done in the C library.
|
||||||
Copyright (C) 1994,95,96,97,99,2001,02 Free Software Foundation, Inc.
|
Copyright (C) 1994,95,96,97,99,2001,2002,2009
|
||||||
|
Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
|
@ -169,33 +170,28 @@ _hurd_locked_install_cttyid (mach_port_t cttyid)
|
||||||
for (i = 0; i < _hurd_dtablesize; ++i)
|
for (i = 0; i < _hurd_dtablesize; ++i)
|
||||||
{
|
{
|
||||||
struct hurd_fd *const d = _hurd_dtable[i];
|
struct hurd_fd *const d = _hurd_dtable[i];
|
||||||
mach_port_t newctty;
|
mach_port_t newctty = MACH_PORT_NULL;
|
||||||
|
|
||||||
if (d == NULL)
|
if (d == NULL)
|
||||||
/* Nothing to do for an unused descriptor cell. */
|
/* Nothing to do for an unused descriptor cell. */
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (cttyid == MACH_PORT_NULL)
|
if (cttyid != MACH_PORT_NULL)
|
||||||
/* We now have no controlling tty at all. */
|
/* We do have some controlling tty. */
|
||||||
newctty = MACH_PORT_NULL;
|
|
||||||
else
|
|
||||||
HURD_PORT_USE (&d->port,
|
HURD_PORT_USE (&d->port,
|
||||||
({ mach_port_t id;
|
({ mach_port_t id;
|
||||||
/* Get the io object's cttyid port. */
|
/* Get the io object's cttyid port. */
|
||||||
if (! __term_getctty (port, &id))
|
if (! __term_getctty (port, &id))
|
||||||
{
|
{
|
||||||
if (id == cttyid && /* Is it ours? */
|
if (id == cttyid /* Is it ours? */
|
||||||
/* Get the ctty io port. */
|
/* Get the ctty io port. */
|
||||||
__term_open_ctty (port,
|
&& __term_open_ctty (port,
|
||||||
_hurd_pid, _hurd_pgrp,
|
_hurd_pid, _hurd_pgrp,
|
||||||
&newctty))
|
&newctty))
|
||||||
/* XXX it is our ctty but the call failed? */
|
/* XXX it is our ctty but the call failed? */
|
||||||
newctty = MACH_PORT_NULL;
|
newctty = MACH_PORT_NULL;
|
||||||
__mach_port_deallocate
|
__mach_port_deallocate (__mach_task_self (), id);
|
||||||
(__mach_task_self (), (mach_port_t) id);
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
newctty = MACH_PORT_NULL;
|
|
||||||
0;
|
0;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue