Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/ipc/kbox.c

    r48bcf49 r716185d  
    4444#include <ipc/kbox.h>
    4545#include <print.h>
    46 #include <proc/thread.h>
    4746
    4847void ipc_kbox_cleanup(void)
     
    206205 * cleanup code.
    207206 *
    208  * @return Phone capability handle on success, or negative error code.
     207 * @return Phone id on success, or negative error code.
    209208 *
    210209 */
     
    236235        }
    237236       
    238         cap_handle_t phone_handle = phone_alloc(TASK);
    239         if (phone_handle < 0) {
    240                 mutex_unlock(&task->kb.cleanup_lock);
    241                 return phone_handle;
    242         }
    243        
    244         kobject_t *phone_obj = kobject_get(TASK, phone_handle,
    245             KOBJECT_TYPE_PHONE);
     237        int newphid = phone_alloc(TASK);
     238        if (newphid < 0) {
     239                mutex_unlock(&task->kb.cleanup_lock);
     240                return ELIMIT;
     241        }
     242       
    246243        /* Connect the newly allocated phone to the kbox */
    247         /* Hand over phone_obj's reference to ipc_phone_connect() */
    248         (void) ipc_phone_connect(phone_obj->phone, &task->kb.box);
     244        (void) ipc_phone_connect(&TASK->phones[newphid], &task->kb.box);
    249245       
    250246        if (task->kb.thread != NULL) {
    251247                mutex_unlock(&task->kb.cleanup_lock);
    252                 return phone_handle;
     248                return newphid;
    253249        }
    254250       
     
    266262        mutex_unlock(&task->kb.cleanup_lock);
    267263       
    268         return phone_handle;
     264        return newphid;
    269265}
    270266
Note: See TracChangeset for help on using the changeset viewer.