This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch, master, updated. glibc-2.11-208-g951ca0c
- From: roland at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 17 Feb 2010 20:41:23 -0000
- Subject: GNU C Library master sources branch, master, updated. glibc-2.11-208-g951ca0c
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, master has been updated
via 951ca0c5ff38620c658be73701bcbc075ae4a53f (commit)
from 0ea5278d33e7ad9b62c1d5d97cb287fdfcb8d977 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=951ca0c5ff38620c658be73701bcbc075ae4a53f
commit 951ca0c5ff38620c658be73701bcbc075ae4a53f
Author: Carl Fredrik Hammar <hammy.lite@gmail.com>
Date: Wed Feb 17 12:41:11 2010 -0800
Clean up Hurd TIOCSCTTY.
diff --git a/ChangeLog b/ChangeLog
index 5c5144b..a3e79d5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2010-02-17 Carl Fredrik Hammar <hammy.lite@gmail.com>
+ * hurd/hurdioctl.c (tiocsctty): Only get FD ports, do work in...
+ (tiocsctty_port): ...this new function.
+
* hurd/hurd/ioctl.h (_HURD_HANDLE_IOCTLS_1): Cast to
`ioctl_handler_t'.
diff --git a/hurd/hurdioctl.c b/hurd/hurdioctl.c
index 7c68984..1da8c05 100644
--- a/hurd/hurdioctl.c
+++ b/hurd/hurdioctl.c
@@ -1,5 +1,5 @@
/* ioctl commands which must be done in the C library.
- Copyright (C) 1994,95,96,97,99,2001,2002,2009
+ Copyright (C) 1994,95,96,97,99,2001,2002,2009,2010
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -239,34 +239,40 @@ _hurd_setcttyid (mach_port_t cttyid)
}
-/* Make FD be the controlling terminal.
- This function is called for `ioctl (fd, TCIOSCTTY)'. */
-
-static int
-tiocsctty (int fd,
- int request) /* Always TIOCSCTTY. */
+static inline error_t
+do_tiocsctty (io_t port, io_t ctty)
{
mach_port_t cttyid;
error_t err;
- /* Get FD's cttyid port, unless it is already ours. */
- err = HURD_DPORT_USE (fd, ctty != MACH_PORT_NULL ? EADDRINUSE :
- __term_getctty (port, &cttyid));
- if (err == EADDRINUSE)
- /* FD is already the ctty. Nothing to do. */
+ if (ctty != MACH_PORT_NULL)
+ /* PORT is already the ctty. Nothing to do. */
return 0;
- else if (err)
- return __hurd_fail (err);
+
+ /* Get PORT's cttyid port. */
+ err = __term_getctty (port, &cttyid);
+ if (err)
+ return err;
/* Change the terminal's pgrp to ours. */
- err = HURD_DPORT_USE (fd, __tioctl_tiocspgrp (port, _hurd_pgrp));
+ err = __tioctl_tiocspgrp (port, _hurd_pgrp);
if (err)
- return __hurd_fail (err);
+ __mach_port_deallocate (__mach_task_self (), cttyid);
+ else
+ /* Make it our own. */
+ install_ctty (cttyid);
- /* Make it our own. */
- install_ctty (cttyid);
+ return err;
+}
- return 0;
+/* Make FD be the controlling terminal.
+ This function is called for `ioctl (fd, TCIOSCTTY)'. */
+
+static int
+tiocsctty (int fd,
+ int request) /* Always TIOCSCTTY. */
+{
+ return __hurd_fail (HURD_DPORT_USE (fd, tiocsctty_port (port, ctty)));
}
_HURD_HANDLE_IOCTL (tiocsctty, TIOCSCTTY);
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 3 +++
hurd/hurdioctl.c | 44 +++++++++++++++++++++++++-------------------
2 files changed, 28 insertions(+), 19 deletions(-)
hooks/post-receive
--
GNU C Library master sources