Changeset 569a51a in mainline for kernel/generic/src/ipc/kbox.c


Ignore:
Timestamp:
2017-12-08T21:17:27Z (8 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0016674
Parents:
071a1ddb
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2017-12-07 16:35:29)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2017-12-08 21:17:27)
Message:

Return phone handle in SYS_IPC_CONNECT_KBOX separately from error code.

File:
1 edited

Legend:

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

    r071a1ddb r569a51a  
    206206 * cleanup code.
    207207 *
    208  * @return Phone capability handle on success, or negative error code.
    209  *
    210  */
    211 int ipc_connect_kbox(task_id_t taskid)
     208 * @param[out] out_phone  Phone capability handle on success.
     209 * @return Error code.
     210 *
     211 */
     212int ipc_connect_kbox(task_id_t taskid, cap_handle_t *out_phone)
    212213{
    213214        irq_spinlock_lock(&tasks_lock, true);
     
    250251        if (task->kb.thread != NULL) {
    251252                mutex_unlock(&task->kb.cleanup_lock);
    252                 return phone_handle;
     253                *out_phone = phone_handle;
     254                return EOK;
    253255        }
    254256       
     
    257259            THREAD_FLAG_NONE, "kbox");
    258260        if (!kb_thread) {
     261                // FIXME: Shouldn't we clean up phone_handle?
    259262                mutex_unlock(&task->kb.cleanup_lock);
    260263                return ENOMEM;
     
    266269        mutex_unlock(&task->kb.cleanup_lock);
    267270       
    268         return phone_handle;
     271        *out_phone = phone_handle;
     272        return EOK;
    269273}
    270274
Note: See TracChangeset for help on using the changeset viewer.