summaryrefslogtreecommitdiff
path: root/debian/patches/fix-libpager-notify-lookups.patch
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2014-04-15 14:18:53 +0200
committerJustus Winter <4winter@informatik.uni-hamburg.de>2014-04-15 14:18:53 +0200
commit5ad5bc5505100f2c55e9ed533b41f9d81605f8fe (patch)
treed2cef2c31361b79b81ef243205f39c43e4d35981 /debian/patches/fix-libpager-notify-lookups.patch
parent1b3dab364a13e45c5cee546fa2ec38df2dfc9d97 (diff)
fixup the fix-libpager-notify-lookups.patch
Diffstat (limited to 'debian/patches/fix-libpager-notify-lookups.patch')
-rw-r--r--debian/patches/fix-libpager-notify-lookups.patch122
1 files changed, 44 insertions, 78 deletions
diff --git a/debian/patches/fix-libpager-notify-lookups.patch b/debian/patches/fix-libpager-notify-lookups.patch
index da7a97f3..74cd92e5 100644
--- a/debian/patches/fix-libpager-notify-lookups.patch
+++ b/debian/patches/fix-libpager-notify-lookups.patch
@@ -1,84 +1,50 @@
-diff --git a/libpager/mig-mutate.h b/libpager/mig-mutate.h
-index 54f7de8..9e9065f 100644
---- a/libpager/mig-mutate.h
-+++ b/libpager/mig-mutate.h
-@@ -20,3 +20,10 @@
- #define MEMORY_OBJECT_INTRAN pager_t begin_using_pager (memory_object_t)
- #define MEMORY_OBJECT_DESTRUCTOR end_using_pager (pager_t)
- #define MEMORY_OBJECT_IMPORTS import "mig-decls.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";
-diff --git a/libpager/notify-stubs.c b/libpager/notify-stubs.c
-index 2d791aa..ba13882 100644
---- a/libpager/notify-stubs.c
-+++ b/libpager/notify-stubs.c
-@@ -23,54 +23,54 @@
- #include <errno.h>
-
- error_t
--_pager_do_seqnos_mach_notify_port_deleted (mach_port_t notify,
-+_pager_do_seqnos_mach_notify_port_deleted (struct port_info *pi,
- mach_port_seqno_t seqno,
- mach_port_t name
- __attribute__ ((unused)))
- {
-- _pager_update_seqno (notify, seqno);
-+ _pager_update_seqno_p ((struct pager *) pi, seqno);
-
- return 0;
- }
-
- error_t
--_pager_do_seqnos_mach_notify_msg_accepted (mach_port_t notify,
-+_pager_do_seqnos_mach_notify_msg_accepted (struct port_info *pi,
- mach_port_seqno_t seqno,
- mach_port_t name
- __attribute__ ((unused)))
- {
-- _pager_update_seqno (notify, seqno);
-+ _pager_update_seqno_p ((struct pager *) pi, seqno);
-
- return 0;
- }
-
- error_t
--_pager_do_seqnos_mach_notify_port_destroyed (mach_port_t notify,
-+_pager_do_seqnos_mach_notify_port_destroyed (struct port_info *pi,
- mach_port_seqno_t seqno,
- mach_port_t name
- __attribute__ ((unused)))
- {
-- _pager_update_seqno (notify, seqno);
-+ _pager_update_seqno_p ((struct pager *) pi, seqno);
-
- return 0;
- }
-
- error_t
--_pager_do_seqnos_mach_notify_send_once (mach_port_t notify,
-+_pager_do_seqnos_mach_notify_send_once (struct port_info *pi,
- mach_port_seqno_t seqno)
- {
-- _pager_update_seqno (notify, seqno);
-+ _pager_update_seqno_p ((struct pager *) pi, seqno);
-
- return 0;
- }
+commit f1aa15a509d4249b19bb3d7f1f388829dd5135f8
+Author: Justus Winter <4winter@informatik.uni-hamburg.de>
+Date: Tue Apr 15 13:54:19 2014 +0200
+
+ libpager: fix notify_port_t receiver lookups
+
+ This fixes one more occurence of a notify_port_t receiver lookup that
+ I overlooked in 5a4926dd52aed56913cbe10592063ff0da753700.
+
+ * libpager/no-senders.c: Include "notify_S.h" so that the compiler can
+ spot such mistakes in the future.
+ (_pager_do_seqnos_mach_notify_no_senders): Fix receiver lookup.
+
+diff --git a/libpager/no-senders.c b/libpager/no-senders.c
+index 83a2c88..c21dfc2 100644
+--- a/libpager/no-senders.c
++++ b/libpager/no-senders.c
+@@ -18,24 +18,19 @@
+
+ #include "priv.h"
+ #include <mach/notify.h>
++#include "notify_S.h"
error_t
--_pager_do_seqnos_mach_notify_dead_name (mach_port_t notify,
-+_pager_do_seqnos_mach_notify_dead_name (struct port_info *pi,
- mach_port_seqno_t seqno,
- mach_port_t name
- __attribute__ ((unused)))
+-_pager_do_seqnos_mach_notify_no_senders (mach_port_t notify,
++_pager_do_seqnos_mach_notify_no_senders (struct port_info *pi,
+ mach_port_seqno_t seqno,
+ mach_port_mscount_t mscount)
{
-- _pager_update_seqno (notify, seqno);
+- struct pager *p = ports_lookup_port (0, notify, _pager_class);
+-
+- if (!p)
++ if (!pi ||
++ pi->class != _pager_class)
+ return EOPNOTSUPP;
+-
+- pthread_mutex_lock (&p->interlock);
+- _pager_wait_for_seqno (p, seqno);
+- _pager_release_seqno (p, seqno);
+- pthread_mutex_unlock (&p->interlock);
+-
+- ports_no_senders (p, mscount);
+-
+- ports_port_deref (p);
++
+ _pager_update_seqno_p ((struct pager *) pi, seqno);
-
++ ports_no_senders (pi, mscount);
++
return 0;
}