Changeset 334c103 in mainline for kernel/generic/src/ipc/ops/conctmeto.c
- Timestamp:
- 2018-03-13T18:01:48Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 87e7a18
- Parents:
- 50dd854
- git-author:
- Jakub Jermar <jakub@…> (2018-03-10 18:18:12)
- git-committer:
- Jakub Jermar <jakub@…> (2018-03-13 18:01:48)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/ipc/ops/conctmeto.c
r50dd854 r334c103 42 42 static errno_t request_preprocess(call_t *call, phone_t *phone) 43 43 { 44 /* 45 * Create the new phone and capability, but don't publish them yet. 46 * That will be done once the phone is connected. 47 */ 44 48 cap_handle_t phone_handle; 45 errno_t rc = phone_alloc(TASK, &phone_handle); 49 kobject_t *phone_obj; 50 errno_t rc = phone_alloc(TASK, false, &phone_handle, &phone_obj); 46 51 if (rc != EOK) { 47 52 call->priv = -1; 48 53 return rc; 49 }50 51 /*52 * The capability is now published, but the phone is not connected yet.53 * The user cannot use it to send anything over it, in fact the54 * userspace can only unpublish and free the capability at this point.55 *56 * We now proceed to test the capability is still there. We don't care57 * if the user destroyed the old one and recreated a new published one58 * of the same type under the same handle.59 *60 * If the capability is in place we temporarily unpublish it to make61 * sure the user cannot fiddle with it while we are connecting.62 */63 64 kobject_t *phone_obj = cap_unpublish(TASK, phone_handle,65 KOBJECT_TYPE_PHONE);66 if (!phone_obj) {67 /*68 * Another thread of the same task can destroy the new69 * capability before we manage to get a reference from it.70 */71 call->priv = -1;72 return ENOENT;73 54 } 74 55
Note:
See TracChangeset
for help on using the changeset viewer.