]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/ipc/mach_port.c
xnu-6153.41.3.tar.gz
[apple/xnu.git] / osfmk / ipc / mach_port.c
index 9f4d8b677246bfa3c8584d257936f7a35b800e08..af47faa37eb5da33dc403780044ce19c4a8869c8 100644 (file)
@@ -725,9 +725,11 @@ mach_port_allocate_internal(
                }
 
                if (qosp->name) {
-                       kr = ipc_port_alloc_name(space, *namep, &port);
+                       kr = ipc_port_alloc_name(space, IPC_PORT_INIT_MESSAGE_QUEUE,
+                           *namep, &port);
                } else {
-                       kr = ipc_port_alloc(space, FALSE, namep, &port);
+                       kr = ipc_port_alloc(space, IPC_PORT_INIT_MESSAGE_QUEUE,
+                           namep, &port);
                }
                if (kr == KERN_SUCCESS) {
                        if (kmsg != IKM_NULL) {
@@ -2499,14 +2501,18 @@ mach_port_construct(
 {
        kern_return_t           kr;
        ipc_port_t              port;
+       ipc_port_init_flags_t   init_flags = IPC_PORT_INIT_MESSAGE_QUEUE;
 
        if (space == IS_NULL) {
                return KERN_INVALID_TASK;
        }
 
+       if (options->flags & MPO_INSERT_SEND_RIGHT) {
+               init_flags |= IPC_PORT_INIT_MAKE_SEND_RIGHT;
+       }
+
        /* Allocate a new port in the IPC space */
-       kr = ipc_port_alloc(space, (options->flags & MPO_INSERT_SEND_RIGHT),
-           name, &port);
+       kr = ipc_port_alloc(space, init_flags, name, &port);
        if (kr != KERN_SUCCESS) {
                return kr;
        }