Changeset 2f44fafd in mainline for uspace/srv/taskman/main.c
- Timestamp:
- 2019-08-07T04:33:20Z (6 years ago)
- Children:
- e0e7eba
- Parents:
- 62273d1
- git-author:
- Michal Koutný <xm.koutny+hos@…> (2015-10-12 21:58:23)
- git-committer:
- Matthieu Riolo <matthieu.riolo@…> (2019-08-07 04:33:20)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/taskman/main.c
r62273d1 r2f44fafd 58 58 static void connect_to_loader(ipc_callid_t iid, ipc_call_t *icall) 59 59 { 60 / /TODO explain why we don't explicitly accept connection request61 /* Spawn aloader. */60 /* We don't accept the connection request, we forward it instead to 61 * freshly spawned loader. */ 62 62 int rc = loader_spawn("loader"); 63 63 … … 79 79 async_exchange_end(exch); 80 80 81 // TODO leak? what happens with referenced sessions 81 /* After forward we can dispose all session-related resources */ 82 async_hangup(sess_ref->sess); 82 83 free(sess_ref); 83 84 … … 153 154 static void control_connection(ipc_callid_t iid, ipc_call_t *icall) 154 155 { 156 /* TODO remove/redesign the workaround 157 * Call task_intro here for boot-time tasks, 158 * probably they should announce themselves explicitly 159 * or taskman should detect them from kernel's list of tasks. 160 */ 161 int rc = task_intro(icall, false); 162 155 163 /* First, accept connection */ 156 async_answer_0(iid, EOK); 157 158 // TODO register task to hash table 164 async_answer_0(iid, rc); 165 166 if (rc != EOK) { 167 return; 168 } 169 159 170 control_connection_loop(); 160 171 } … … 174 185 sess_ref->sess = async_callback_receive_start(EXCHANGE_ATOMIC, icall); 175 186 if (sess_ref->sess == NULL) { 176 //TODO different error code?177 187 async_answer_0(iid, EINVAL); 178 188 return; … … 180 190 181 191 /* Remember task_id */ 182 int rc = task_i d_intro(icall);192 int rc = task_intro(icall, true); 183 193 184 194 if (rc != EOK) { … … 222 232 case TASKMAN_LOADER_CALLBACK: 223 233 loader_callback(iid, icall); 224 // TODO register task to hashtable225 234 control_connection_loop(); 226 235 break; … … 245 254 } 246 255 247 rc = async_event_subscribe(EVENT_EXIT, task_exit_event, (void *) EVENT_EXIT);256 rc = async_event_subscribe(EVENT_EXIT, task_exit_event, (void *)TASK_EXIT_NORMAL); 248 257 if (rc != EOK) { 249 258 printf("Cannot register for exit events (%i).\n", rc); … … 251 260 } 252 261 253 rc = async_event_subscribe(EVENT_FAULT, task_exit_event, (void *) EVENT_FAULT);262 rc = async_event_subscribe(EVENT_FAULT, task_exit_event, (void *)TASK_EXIT_UNEXPECTED); 254 263 if (rc != EOK) { 255 264 printf("Cannot register for fault events (%i).\n", rc);
Note:
See TracChangeset
for help on using the changeset viewer.