Changeset 05ffb41 in mainline for kernel/generic/src/ipc/ops/connclone.c
- Timestamp:
- 2017-08-17T19:11:14Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1c85bae
- Parents:
- 7e3826d9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/ipc/ops/connclone.c
r7e3826d9 r05ffb41 61 61 static int request_preprocess(call_t *call, phone_t *phone) 62 62 { 63 phone_t *cloned_phone; 64 65 if (phone_get(IPC_GET_ARG1(call->data), &cloned_phone) != EOK) 63 phone_t *cloned_phone = phone_get_current(IPC_GET_ARG1(call->data)); 64 if (!cloned_phone) 66 65 return ENOENT; 67 66 68 67 phones_lock(cloned_phone, phone); 69 68 70 69 if ((cloned_phone->state != IPC_PHONE_CONNECTED) || 71 70 phone->state != IPC_PHONE_CONNECTED) { … … 73 72 return EINVAL; 74 73 } 75 74 76 75 /* 77 76 * We can be pretty sure now that both tasks exist and we are … … 81 80 * 82 81 */ 83 int newphid= phone_alloc(phone->callee->task);84 if ( newphid< 0) {82 int cap = phone_alloc(phone->callee->task); 83 if (cap < 0) { 85 84 phones_unlock(cloned_phone, phone); 86 85 return ELIMIT; 87 86 } 88 89 (void) ipc_phone_connect( &phone->callee->task->phones[newphid],87 88 (void) ipc_phone_connect(phone_get(phone->callee->task, cap), 90 89 cloned_phone->callee); 91 90 phones_unlock(cloned_phone, phone); 92 91 93 92 /* Set the new phone for the callee. */ 94 IPC_SET_ARG1(call->data, newphid);93 IPC_SET_ARG1(call->data, cap); 95 94 96 95 return EOK; … … 99 98 static int answer_cleanup(call_t *answer, ipc_data_t *olddata) 100 99 { 101 int phoneid= (int) IPC_GET_ARG1(*olddata);102 phone_t *phone = &TASK->phones[phoneid];100 int cap = (int) IPC_GET_ARG1(*olddata); 101 phone_t *phone = phone_get_current(cap); 103 102 104 103 /*
Note:
See TracChangeset
for help on using the changeset viewer.