[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 37/53: term: fix receiver lookups in the term server functions
From: |
Samuel Thibault |
Subject: |
[hurd] 37/53: term: fix receiver lookups in the term server functions |
Date: |
Thu, 20 Mar 2014 02:23:52 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch upstream
in repository hurd.
commit e3a2c2caeea0a4f4d36b1117610d2a32d14ac69b
Author: Justus Winter <address@hidden>
Date: Fri Feb 28 11:47:10 2014 +0100
term: fix receiver lookups in the term server functions
* term/mig-mutate.h: Define TERM_IMPORTS.
* term/Makefile: Set term-MIGSFLAGS.
* term/users.c: Fix receiver lookups in the term server functions.
---
term/Makefile | 1 +
term/mig-mutate.h | 1 +
term/users.c | 82 ++++++++++++++++++++++++++-----------------------------
3 files changed, 40 insertions(+), 44 deletions(-)
diff --git a/term/Makefile b/term/Makefile
index 9537c60..5006c0d 100644
--- a/term/Makefile
+++ b/term/Makefile
@@ -34,3 +34,4 @@ include ../Makeconf
device_replyServer-CPPFLAGS = -DTypeCheck=0 -Wno-unused # XXX
tioctl-MIGSFLAGS = -imacros $(srcdir)/mig-mutate.h
+term-MIGSFLAGS = -imacros $(srcdir)/mig-mutate.h
diff --git a/term/mig-mutate.h b/term/mig-mutate.h
index 7cc13aa..a6b99fe 100644
--- a/term/mig-mutate.h
+++ b/term/mig-mutate.h
@@ -22,3 +22,4 @@
#define IO_INTRAN trivfs_protid_t trivfs_begin_using_protid (io_t)
#define IO_DESTRUCTOR trivfs_end_using_protid (trivfs_protid_t)
#define TIOCTL_IMPORTS import "../libtrivfs/mig-decls.h";
+#define TERM_IMPORTS import "../libtrivfs/mig-decls.h";
diff --git a/term/users.c b/term/users.c
index 3f55839..9ec9594 100644
--- a/term/users.c
+++ b/term/users.c
@@ -352,15 +352,15 @@ trivfs_modify_stat (struct trivfs_protid *cred, struct
stat *st)
/* Implement term_getctty as described in <hurd/term.defs>. */
kern_return_t
-S_term_getctty (mach_port_t arg,
+S_term_getctty (struct trivfs_protid *cred,
mach_port_t *id,
mach_msg_type_name_t *idtype)
{
- struct trivfs_protid *cred = ports_lookup_port (term_bucket,
- arg, tty_class);
error_t err;
- if (!cred)
+ if (!cred
+ || cred->pi.bucket != term_bucket
+ || cred->pi.class != tty_class)
return EOPNOTSUPP;
pthread_mutex_lock (&global_lock);
@@ -373,7 +373,6 @@ S_term_getctty (mach_port_t arg,
*idtype = MACH_MSG_TYPE_MAKE_SEND;
err = 0;
}
- ports_port_deref (cred);
pthread_mutex_unlock (&global_lock);
return err;
}
@@ -390,7 +389,6 @@ S_termctty_open_terminal (mach_port_t arg,
struct iouser *user;
struct trivfs_protid *newcred;
struct port_info *pi = ports_lookup_port (term_bucket, arg, cttyid_class);
-
if (!pi)
return EOPNOTSUPP;
@@ -417,7 +415,7 @@ S_termctty_open_terminal (mach_port_t arg,
/* Implement term_become_ctty as described in <hurd/term.defs>. */
kern_return_t
-S_term_open_ctty (mach_port_t arg,
+S_term_open_ctty (struct trivfs_protid *cred,
pid_t pid,
pid_t pgrp,
mach_port_t *newpt,
@@ -425,14 +423,14 @@ S_term_open_ctty (mach_port_t arg,
{
error_t err;
struct trivfs_protid *newcred;
- struct trivfs_protid *cred = ports_lookup_port (term_bucket, arg, tty_class);
- if (!cred)
+ if (!cred
+ || cred->pi.bucket != term_bucket
+ || cred->pi.class != tty_class)
return EOPNOTSUPP;
if (pid <= 0 || pgrp <= 0)
{
- ports_port_deref (cred);
return EINVAL;
}
@@ -469,8 +467,6 @@ S_term_open_ctty (mach_port_t arg,
}
}
- ports_port_deref (cred);
-
return err;
}
@@ -2132,62 +2128,62 @@ report_carrier_error (error_t err)
}
kern_return_t
-S_term_get_nodename (io_t arg,
+S_term_get_nodename (struct trivfs_protid *cred,
char *name)
{
- struct trivfs_protid *cred = ports_lookup_port (term_bucket, arg,
- tty_class);
- if (!cred)
+ if (!cred
+ || cred->pi.bucket != term_bucket
+ || cred->pi.class != tty_class)
return EOPNOTSUPP;
if (!cred->po->cntl->hook)
{
- ports_port_deref (cred);
return ENOENT;
}
strcpy (name, (char *)cred->po->cntl->hook);
- ports_port_deref (cred);
return 0;
}
kern_return_t
-S_term_set_nodename (io_t arg,
+S_term_set_nodename (struct trivfs_protid *cred,
char *name)
{
error_t err = 0;
- struct trivfs_protid *cred = ports_lookup_port (term_bucket, arg, tty_class);
- if (!cred)
+ if (!cred
+ || cred->pi.bucket != term_bucket
+ || cred->pi.class != tty_class)
return EOPNOTSUPP;
if (strcmp (name, (char *)cred->po->cntl->hook) != 0)
err = EINVAL;
- ports_port_deref (cred);
return err;
}
kern_return_t
-S_term_set_filenode (io_t arg,
+S_term_set_filenode (struct trivfs_protid *cred,
file_t filenode)
{
- struct trivfs_protid *cred = ports_lookup_port (term_bucket, arg,
- tty_class);
- if (!cred)
+ if (!cred
+ || cred->pi.bucket != term_bucket
+ || cred->pi.class != tty_class)
return EOPNOTSUPP;
- ports_port_deref (cred);
return EINVAL;
}
kern_return_t
-S_term_get_peername (io_t arg,
+S_term_get_peername (struct trivfs_protid *cred,
char *name)
{
- struct trivfs_protid *cred = ports_lookup_port (term_bucket, arg, 0);
struct trivfs_control *peer;
+ if (!cred
+ || cred->pi.bucket != term_bucket)
+ return EOPNOTSUPP;
+
if (!cred || (cred->pi.class != tty_class && cred->pi.class != pty_class))
{
if (cred)
@@ -2204,47 +2200,45 @@ S_term_get_peername (io_t arg,
}
strcpy (name, (char *) peer->hook);
- ports_port_deref (cred);
return 0;
}
kern_return_t
-S_term_get_bottom_type (io_t arg,
+S_term_get_bottom_type (struct trivfs_protid *cred,
int *ttype)
{
- struct trivfs_protid *cred = ports_lookup_port (term_bucket,
- arg, tty_class);
- if (!cred)
+ if (!cred
+ || cred->pi.bucket != term_bucket
+ || cred->pi.class != tty_class)
return EOPNOTSUPP;
- ports_port_deref (cred);
*ttype = bottom->type;
return 0;
}
kern_return_t
-S_term_on_machdev (io_t arg,
+S_term_on_machdev (struct trivfs_protid *cred,
device_t machdev)
{
- struct trivfs_protid *cred = ports_lookup_port (term_bucket, arg,
- tty_class);
- if (!cred)
+ if (!cred
+ || cred->pi.bucket != term_bucket
+ || cred->pi.class != tty_class)
return EOPNOTSUPP;
- ports_port_deref (cred);
+
return EINVAL;
}
kern_return_t
-S_term_on_hurddev (io_t arg,
- io_t hurddev)
+S_term_on_hurddev (struct trivfs_protid *cred,
+ struct trivfs_protid *hurddev)
{
return EOPNOTSUPP;
}
kern_return_t
-S_term_on_pty (io_t arg,
- mach_port_t *master)
+S_term_on_pty (struct trivfs_protid *cred,
+ struct trivfs_protid **master)
{
return EOPNOTSUPP;
}
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] 40/53: mach-defpager: remove comments around form feeds, (continued)
- [hurd] 40/53: mach-defpager: remove comments around form feeds, Samuel Thibault, 2014/03/19
- [hurd] 45/53: mach-defpager: fix warnings about uninitialized variables, Samuel Thibault, 2014/03/19
- [hurd] 41/53: mach-defpager: fix warnings about unused variables, Samuel Thibault, 2014/03/19
- [hurd] 32/53: pfinet: improve the mig mutator functions, Samuel Thibault, 2014/03/19
- [hurd] 47/53: mach-defpager: silently ignore requests to page to active partition, Samuel Thibault, 2014/03/19
- [hurd] 46/53: mach-defpager: fix type of size arguments, Samuel Thibault, 2014/03/19
- [hurd] 35/53: pfinet: fix receiver lookups in iioctl-ops.c, Samuel Thibault, 2014/03/19
- [hurd] 49/53: Merge branch 'master' of git.savannah.gnu.org:/srv/git/hurd/hurd, Samuel Thibault, 2014/03/19
- [hurd] 30/53: libnetfs: fix receiver lookups in fsys server functions, Samuel Thibault, 2014/03/19
- [hurd] 50/53: Fix crash on accessing vcs without a console being active, Samuel Thibault, 2014/03/19
- [hurd] 37/53: term: fix receiver lookups in the term server functions,
Samuel Thibault <=
- [hurd] 33/53: libtrivfs: improve the mig mutator functions, Samuel Thibault, 2014/03/19
- [hurd] 51/53: Fix vcs_readlink propagating error returned by console_current_id, Samuel Thibault, 2014/03/19
- [hurd] 53/53: Merge remote-tracking branch 'upstream/master' into upstream, Samuel Thibault, 2014/03/19
- [hurd] 52/53: Fix handling of console readlink errors, Samuel Thibault, 2014/03/19
- [hurd] 04/53: isofs: add bz2 to OTHERLIBS, Samuel Thibault, 2014/03/19
- [hurd] 11/53: Merge branch 'master' of git.savannah.gnu.org:/srv/git/hurd/hurd, Samuel Thibault, 2014/03/19
- [hurd] 09/53: libdiskfs: fix typo, Samuel Thibault, 2014/03/19
- [hurd] 13/53: Add missing copyright notice, Samuel Thibault, 2014/03/19
- [hurd] 42/53: mach-defpager: add and use synchronized_printf for dprintf, Samuel Thibault, 2014/03/19
- [hurd] 05/53: fatfs: add bz2 to OTHERLIBS, Samuel Thibault, 2014/03/19