Changes in kernel/generic/src/ipc/kbox.c [48bcf49:716185d] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/ipc/kbox.c
r48bcf49 r716185d 44 44 #include <ipc/kbox.h> 45 45 #include <print.h> 46 #include <proc/thread.h>47 46 48 47 void ipc_kbox_cleanup(void) … … 206 205 * cleanup code. 207 206 * 208 * @return Phone capability handleon success, or negative error code.207 * @return Phone id on success, or negative error code. 209 208 * 210 209 */ … … 236 235 } 237 236 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 246 243 /* 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); 249 245 250 246 if (task->kb.thread != NULL) { 251 247 mutex_unlock(&task->kb.cleanup_lock); 252 return phone_handle;248 return newphid; 253 249 } 254 250 … … 266 262 mutex_unlock(&task->kb.cleanup_lock); 267 263 268 return phone_handle;264 return newphid; 269 265 } 270 266
Note:
See TracChangeset
for help on using the changeset viewer.