[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 12/61: console: fix notify_port_t receiver lookups
From: |
Samuel Thibault |
Subject: |
[hurd] 12/61: console: fix notify_port_t receiver lookups |
Date: |
Tue, 27 May 2014 08:32:10 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch upstream
in repository hurd.
commit 210793d5144562f2ab51a8b3f0969ab498a6a9c7
Author: Justus Winter <address@hidden>
Date: Sun Apr 13 19:29:57 2014 +0200
console: fix notify_port_t receiver lookups
This complements e9687ec4ff525ae4a88314ba4ae97da770bd012f.
* console/display.c: Fix receiver lookups, adjust function declarations.
* console/mutations.h: Add NOTIFY mutators.
---
console/display.c | 39 +++++++++++++++++++++------------------
console/mutations.h | 7 +++++++
2 files changed, 28 insertions(+), 18 deletions(-)
diff --git a/console/display.c b/console/display.c
index 8d9e478..09add5c 100644
--- a/console/display.c
+++ b/console/display.c
@@ -42,6 +42,7 @@
#include "display.h"
#include "pager.h"
+#include "notify_S.h"
struct changes
{
@@ -318,7 +319,7 @@ free_modreqs (struct modreq *mr)
/* A port deleted notification is generated when we deallocate the
user's notify port before it is dead. */
error_t
-do_mach_notify_port_deleted (mach_port_t notify, mach_port_t name)
+do_mach_notify_port_deleted (struct port_info *pi, mach_port_t name)
{
/* As we cancel the dead-name notification before deallocating the
port, this should not happen. */
@@ -327,15 +328,16 @@ do_mach_notify_port_deleted (mach_port_t notify,
mach_port_t name)
/* We request dead name notifications for the user ports. */
error_t
-do_mach_notify_dead_name (mach_port_t notify, mach_port_t dead_name)
+do_mach_notify_dead_name (struct port_info *pi, mach_port_t dead_name)
{
- struct notify *notify_port = ports_lookup_port (notify_bucket,
- notify, notify_class);
+ struct notify *notify_port = (struct notify *) pi;
struct display *display;
struct modreq **preq;
struct modreq *req;
- if (!notify_port)
+ if (!notify_port
+ || notify_port->pi.bucket != notify_bucket
+ || notify_port->pi.class != notify_class)
return EOPNOTSUPP;
display = notify_port->display;
@@ -369,30 +371,35 @@ do_mach_notify_dead_name (mach_port_t notify, mach_port_t
dead_name)
return 0;
}
-void do_mach_notify_port_destroyed (void) { assert (0); }
+error_t
+do_mach_notify_port_destroyed (struct port_info *pi, mach_port_t rights)
+{
+ assert (0);
+}
error_t
-do_mach_notify_no_senders (mach_port_t port, mach_port_mscount_t count)
+do_mach_notify_no_senders (struct port_info *pi, mach_port_mscount_t count)
{
- return ports_do_mach_notify_no_senders (port, count);
+ return ports_do_mach_notify_no_senders (pi, count);
}
kern_return_t
-do_mach_notify_send_once (mach_port_t notify)
+do_mach_notify_send_once (struct port_info *pi)
{
return 0;
}
kern_return_t
-do_mach_notify_msg_accepted (mach_port_t notify, mach_port_t send)
+do_mach_notify_msg_accepted (struct port_info *pi, mach_port_t send)
{
- struct notify *notify_port = ports_lookup_port (notify_bucket,
- notify, notify_class);
+ struct notify *notify_port = (struct notify *) pi;
struct display *display;
struct modreq **preq;
struct modreq *req;
- if (!notify_port)
+ if (!notify_port
+ || notify_port->pi.bucket != notify_bucket
+ || notify_port->pi.class != notify_class)
return EOPNOTSUPP;
/* If we deallocated the send right in display_destroy before the
@@ -401,7 +408,6 @@ do_mach_notify_msg_accepted (mach_port_t notify,
mach_port_t send)
if (!send)
{
assert(0);
- ports_port_deref (notify_port);
return 0;
}
@@ -418,7 +424,6 @@ do_mach_notify_msg_accepted (mach_port_t notify,
mach_port_t send)
{
assert(0);
pthread_mutex_unlock (&display->lock);
- ports_port_deref (notify_port);
return 0;
}
req = *preq;
@@ -430,7 +435,7 @@ do_mach_notify_msg_accepted (mach_port_t notify,
mach_port_t send)
and stay in pending queue. */
req->pending = 0;
err = nowait_file_changed (req->port, 0, FILE_CHANGED_WRITE, -1, -1,
- notify);
+ notify_port->pi.port_right);
if (err && err != MACH_SEND_WILL_NOTIFY)
{
mach_port_t old;
@@ -446,7 +451,6 @@ do_mach_notify_msg_accepted (mach_port_t notify,
mach_port_t send)
mach_port_deallocate (mach_task_self (), req->port);
free (req);
- ports_port_deref (notify_port);
return err;
}
if (err == MACH_SEND_WILL_NOTIFY)
@@ -462,7 +466,6 @@ do_mach_notify_msg_accepted (mach_port_t notify,
mach_port_t send)
req->next = display->filemod_reqs;
display->filemod_reqs = req;
pthread_mutex_unlock (&display->lock);
- ports_port_deref (notify_port);
return 0;
}
diff --git a/console/mutations.h b/console/mutations.h
index 5f26672..c1867a0 100644
--- a/console/mutations.h
+++ b/console/mutations.h
@@ -24,3 +24,10 @@
#define IO_DESTRUCTOR end_using_protid_port (protid_t)
#define TIOCTL_IMPORTS import "priv.h";
+
+#define NOTIFY_INTRAN \
+ port_info_t begin_using_port_info_port (mach_port_t)
+#define NOTIFY_DESTRUCTOR \
+ end_using_port_info (port_info_t)
+#define NOTIFY_IMPORTS \
+ import "libports/mig-decls.h";
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] 05/61: exec: fix receiver lookup, (continued)
- [hurd] 05/61: exec: fix receiver lookup, Samuel Thibault, 2014/05/27
- [hurd] 08/61: hurd: add a new type interrupt_t for the interrupt protocol, Samuel Thibault, 2014/05/27
- [hurd] 09/61: libports: fix receiver lookup, Samuel Thibault, 2014/05/27
- [hurd] 06/61: libdiskfs: fix receiver lookup, Samuel Thibault, 2014/05/27
- [hurd] 11/61: boot: remove the ourdevice hack, Samuel Thibault, 2014/05/27
- [hurd] 01/61: libpager: fix receiver lookups, Samuel Thibault, 2014/05/27
- [hurd] 03/61: Merge branch 'master' of git.savannah.gnu.org:/srv/git/hurd/hurd, Samuel Thibault, 2014/05/27
- [hurd] 19/61: Add missing receiver lookup fix, Samuel Thibault, 2014/05/27
- [hurd] 13/61: libpager: fix notify_port_t receiver lookups, Samuel Thibault, 2014/05/27
- [hurd] 20/61: libdiskfs: set the default sync interval to 30 seconds, Samuel Thibault, 2014/05/27
- [hurd] 12/61: console: fix notify_port_t receiver lookups,
Samuel Thibault <=
- [hurd] 21/61: libports: work around bugs in server termination, Samuel Thibault, 2014/05/27
- [hurd] 18/61: Merge branch 'master' of git.savannah.gnu.org:/srv/git/hurd/hurd, Samuel Thibault, 2014/05/27
- [hurd] 16/61: build: Remove configure check for libcrypt., Samuel Thibault, 2014/05/27
- [hurd] 28/61: fatfs: improve diskfs_node_iterate, Samuel Thibault, 2014/05/27
- [hurd] 26/61: fatfs: simplify expression, Samuel Thibault, 2014/05/27
- [hurd] 29/61: tmpfs: improve diskfs_node_iterate, Samuel Thibault, 2014/05/27
- [hurd] 07/61: libports: fix notify_port_t receiver lookups, Samuel Thibault, 2014/05/27
- [hurd] 14/61: libpager: fix notify_port_t receiver lookups, Samuel Thibault, 2014/05/27
- [hurd] 34/61: libihash: reduce the default maximum load factor to 75%, Samuel Thibault, 2014/05/27
- [hurd] 17/61: Add TODO about fork() making rpctrace emit an error, Samuel Thibault, 2014/05/27