summaryrefslogtreecommitdiff
path: root/debian/patches/random-fixes0005-pflocal-convert-to-trivfs-dynamic-classes-and-bucket.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/random-fixes0005-pflocal-convert-to-trivfs-dynamic-classes-and-bucket.patch')
-rw-r--r--debian/patches/random-fixes0005-pflocal-convert-to-trivfs-dynamic-classes-and-bucket.patch81
1 files changed, 81 insertions, 0 deletions
diff --git a/debian/patches/random-fixes0005-pflocal-convert-to-trivfs-dynamic-classes-and-bucket.patch b/debian/patches/random-fixes0005-pflocal-convert-to-trivfs-dynamic-classes-and-bucket.patch
new file mode 100644
index 00000000..d9cadbd3
--- /dev/null
+++ b/debian/patches/random-fixes0005-pflocal-convert-to-trivfs-dynamic-classes-and-bucket.patch
@@ -0,0 +1,81 @@
+From 346422b9d01e1be3e71d091dde81db848ef6ef99 Mon Sep 17 00:00:00 2001
+From: Justus Winter <4winter@informatik.uni-hamburg.de>
+Date: Sun, 27 Sep 2015 17:01:37 +0200
+Subject: [PATCH hurd 05/10] pflocal: convert to trivfs dynamic classes and
+ buckets
+
+libtrivfs contains two ways of managing more than one port class and
+bucket. There is the old way of using a statically allocated array
+with explicit length, and the new way with dynamically allocated
+vectors.
+
+Converting all users to the new way of handling multiple classes
+and/or buckets, we can simplify the code in libtrivfs. In many cases,
+the code will be simpler and more expressive for the user.
+
+This also fixes a mild bug. The classes and buckets given to
+`trivfs_startup' end up in the dynamic vectors too, making the object
+lookup code use the more complicated code path.
+
+* pflocal/pflocal.c: Convert to dynamic classes and buckets.
+---
+ pflocal/pflocal.c | 20 ++++----------------
+ 1 file changed, 4 insertions(+), 16 deletions(-)
+
+diff --git a/pflocal/pflocal.c b/pflocal/pflocal.c
+index fcb62d1..07d1a97 100644
+--- a/pflocal/pflocal.c
++++ b/pflocal/pflocal.c
+@@ -38,12 +38,6 @@ int trivfs_support_read = 0;
+ int trivfs_support_write = 0;
+ int trivfs_support_exec = 0;
+ int trivfs_allow_open = 0;
+-
+-/* Trivfs noise. */
+-struct port_class *trivfs_protid_portclasses[1];
+-struct port_class *trivfs_cntl_portclasses[1];
+-int trivfs_protid_nportclasses = 1;
+-int trivfs_cntl_nportclasses = 1;
+
+ /* ---------------------------------------------------------------- */
+ #include "socket_S.h"
+@@ -70,6 +64,7 @@ main(int argc, char *argv[])
+ {
+ error_t err;
+ mach_port_t bootstrap;
++ struct trivfs_control *fsys;
+
+ if (argc > 1)
+ {
+@@ -81,25 +76,18 @@ main(int argc, char *argv[])
+ if (bootstrap == MACH_PORT_NULL)
+ error(2, 0, "Must be started as a translator");
+
+- pf_port_bucket = ports_create_bucket ();
+-
+- trivfs_cntl_portclasses[0] = ports_create_class (trivfs_clean_cntl, 0);
+- trivfs_protid_portclasses[0] = ports_create_class (trivfs_clean_protid, 0);
+-
+ /* Prepare to create sockets. */
+ err = sock_global_init ();
+ if (err)
+ error(3, err, "Initializing");
+
+ /* Reply to our parent */
+- err =
+- trivfs_startup (bootstrap, 0,
+- trivfs_cntl_portclasses[0], pf_port_bucket,
+- trivfs_protid_portclasses[0], pf_port_bucket,
+- NULL);
++ err = trivfs_startup (bootstrap, 0, 0, 0, 0, 0, &fsys);
+ if (err)
+ error(3, err, "Contacting parent");
+
++ pf_port_bucket = fsys->pi.bucket;
++
+ /* Launch. */
+ do
+ ports_manage_port_operations_multithread (pf_port_bucket,
+--
+2.1.4
+