bug-hurd
[Top][All Lists]
Advanced

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

[PATCH 1/6] libmachdev: fix device_open


From: Justus Winter
Subject: [PATCH 1/6] libmachdev: fix device_open
Date: Sun, 13 Apr 2014 13:43:09 +0200

device_open used to explicitly call ds_device_open_reply instead of
just letting the mig-generated wrapper around ds_device_open generate
the return message.  There is really no need for that.

* libmachdev/net.c: Do not include device_reply_U.h.
(device_open): Do not call ds_device_open_reply.
Set *devicePoly to MACH_MSG_TYPE_MAKE_SEND.
---
 libmachdev/ds_routines.c |  1 -
 libmachdev/net.c         | 13 ++++++-------
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/libmachdev/ds_routines.c b/libmachdev/ds_routines.c
index 0e431a3..44f1139 100644
--- a/libmachdev/ds_routines.c
+++ b/libmachdev/ds_routines.c
@@ -64,7 +64,6 @@
 
 #include "vm_param.h"
 #include "device_S.h"
-#include "device_reply_U.h"
 #include "io_req.h"
 #include "dev_hdr.h"
 #include "util.h"
diff --git a/libmachdev/net.c b/libmachdev/net.c
index 501c9bb..300d946 100644
--- a/libmachdev/net.c
+++ b/libmachdev/net.c
@@ -368,15 +368,14 @@ device_open (mach_port_t reply_port, mach_msg_type_name_t 
reply_port_type,
            dev->set_multicast_list (dev);
 #endif
        }
-      if (MACH_PORT_VALID (reply_port))
-       ds_device_open_reply (reply_port, reply_port_type,
-                             err, dev_to_port (nd));
-      return MIG_NO_REPLY;
     }
 
-  *devp = ports_get_right (nd);
-  *devicePoly = MACH_MSG_TYPE_COPY_SEND;
-  return D_SUCCESS;
+  if (nd)
+    {
+      *devp = ports_get_right (nd);
+      *devicePoly = MACH_MSG_TYPE_MAKE_SEND;
+    }
+  return err;
 }
 
 static io_return_t
-- 
1.9.1




reply via email to

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