[PATCH,HURD]: Fix uninitialized newctty variable
Samuel Thibault
samuel.thibault@ens-lyon.org
Tue Dec 22 20:28:00 GMT 2009
Hello,
The patch below fixes an unitialized variable issue.
Samuel
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.
diff --git a/hurd/hurdioctl.c b/hurd/hurdioctl.c
index 96d910b..b3c9605 100644
--- a/hurd/hurdioctl.c
+++ b/hurd/hurdioctl.c
@@ -184,12 +184,16 @@ _hurd_locked_install_cttyid (mach_port_t cttyid)
/* Get the io object's cttyid port. */
if (! __term_getctty (port, &id))
{
- if (id == cttyid && /* Is it ours? */
+ if (id == cttyid) /* Is it ours? */
+ {
/* Get the ctty io port. */
- __term_open_ctty (port,
- _hurd_pid, _hurd_pgrp,
- &newctty))
- /* XXX it is our ctty but the call failed? */
+ if (__term_open_ctty (port,
+ _hurd_pid, _hurd_pgrp,
+ &newctty))
+ /* XXX it is our ctty but the call failed? */
+ newctty = MACH_PORT_NULL;
+ }
+ else
newctty = MACH_PORT_NULL;
__mach_port_deallocate
(__mach_task_self (), (mach_port_t) id);
More information about the Libc-alpha
mailing list