bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] hurd: ensure subsystem directive appears before anything else in


From: Flavio Cruz
Subject: [PATCH] hurd: ensure subsystem directive appears before anything else in *.defs
Date: Sun, 13 Nov 2022 00:26:13 -0500

mig is incorrectly initializing basic types twice (init_type) for kernel 
user and kernel server definitions. To fix this bug, we should 
initialize the types during a subsystem directive only. This commit 
ensures all hurd definitions have subsystem at the very start so that
these definitions work correctly with a patched mig.

---
 hurd/iioctl.defs  | 7 +++----
 hurd/kdioctl.defs | 4 ++--
 hurd/rioctl.defs  | 8 ++++----
 hurd/tioctl.defs  | 6 +++---
 4 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/hurd/iioctl.defs b/hurd/iioctl.defs
index 6fa05a5d..ff54a40c 100644
--- a/hurd/iioctl.defs
+++ b/hurd/iioctl.defs
@@ -17,6 +17,9 @@ You should have received a copy of the GNU General Public 
License
 along with the GNU Hurd; see the file COPYING.  If not, write to
 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
+/* Ioctl class `i'; the subsystem is derived from calculations in
+   <ioctls.h>. */
+subsystem iioctl 112000; /* XXX */
 
 #include <hurd/hurd_types.defs>
 
@@ -26,10 +29,6 @@ IIOCTL_IMPORTS
 
 INTR_INTERFACE
 
-/* Ioctl class `i'; the subsystem is derived from calculations in
-   <ioctls.h>. */
-subsystem iioctl 112000; /* XXX */
-
 import <hurd/ioctl_types.h>; /* XXX */
 
 /* This is the first arg for a struct ifreq_something as specified by the
diff --git a/hurd/kdioctl.defs b/hurd/kdioctl.defs
index 64f9b9ea..0dd09d38 100644
--- a/hurd/kdioctl.defs
+++ b/hurd/kdioctl.defs
@@ -17,12 +17,12 @@ You should have received a copy of the GNU General Public 
License
 along with the GNU Hurd; see the file COPYING.  If not, write to
 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
-#include <hurd/hurd_types.defs>
-
 /* Ioctl class `k'; the subsystem is derived from calculations in
    <ioctls.h>. */
 subsystem kdioctl 120000;
 
+#include <hurd/hurd_types.defs>
+
 import <hurd/ioctl_types.h>;
 
 skip;  /* 0  unused */
diff --git a/hurd/rioctl.defs b/hurd/rioctl.defs
index 595eb7c2..c4b88e5c 100644
--- a/hurd/rioctl.defs
+++ b/hurd/rioctl.defs
@@ -18,6 +18,10 @@ along with the GNU Hurd; see the file COPYING.  If not, 
write to
 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
 
+/* Ioctl class `r'; the subsystem is derived from calculations in
+   <ioctls.h>. */
+subsystem rioctl 148000; /* XXX */
+
 #include <hurd/hurd_types.defs>
 
 #ifdef RIOCTL_IMPORTS
@@ -26,10 +30,6 @@ RIOCTL_IMPORTS
 
 INTR_INTERFACE
 
-/* Ioctl class `r'; the subsystem is derived from calculations in
-   <ioctls.h>. */
-subsystem rioctl 148000; /* XXX */
-
 import <hurd/ioctl_types.h>; /* XXX */
 
 /* This is the first arg for a struct ifreq_something as specified by the
diff --git a/hurd/tioctl.defs b/hurd/tioctl.defs
index 58ee698f..905a4a38 100644
--- a/hurd/tioctl.defs
+++ b/hurd/tioctl.defs
@@ -17,6 +17,9 @@ You should have received a copy of the GNU General Public 
License
 along with the GNU Hurd; see the file COPYING.  If not, write to
 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
+/* Ioctl class `t'; the subsystem is derived from calculations in
+   <ioctls.h>. */
+subsystem tioctl 156000; /* XXX */
 
 #include <hurd/hurd_types.defs>
 
@@ -26,9 +29,6 @@ TIOCTL_IMPORTS
 
 INTR_INTERFACE
 
-/* Ioctl class `t'; the subsystem is derived from calculations in
-   <ioctls.h>. */
-subsystem tioctl 156000; /* XXX */
 
 import <hurd/ioctl_types.h>; /* XXX */
 
-- 
2.37.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]