Changes in uspace/srv/loader/main.c [622cdbe:5d96851] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/loader/main.c
r622cdbe r5d96851 72 72 static pcb_t pcb; 73 73 74 /** Current working directory */75 static char *cwd = NULL;76 77 74 /** Number of arguments */ 78 75 static int argc = 0; … … 105 102 task_id = task_get_id(); 106 103 107 if (! async_data_read_receive(&callid, &len)) {104 if (!ipc_data_read_receive(&callid, &len)) { 108 105 ipc_answer_0(callid, EINVAL); 109 106 ipc_answer_0(rid, EINVAL); … … 114 111 len = sizeof(task_id); 115 112 116 async_data_read_finalize(callid, &task_id, len);113 ipc_data_read_finalize(callid, &task_id, len); 117 114 ipc_answer_0(rid, EOK); 118 115 } 119 116 120 /** Receive a call setting the current working directory.121 *122 * @param rid123 * @param request124 */125 static void ldr_set_cwd(ipc_callid_t rid, ipc_call_t *request)126 {127 ipc_callid_t callid;128 size_t len;129 130 if (!async_data_write_receive(&callid, &len)) {131 ipc_answer_0(callid, EINVAL);132 ipc_answer_0(rid, EINVAL);133 return;134 }135 136 cwd = malloc(len + 1);137 if (!cwd) {138 ipc_answer_0(callid, ENOMEM);139 ipc_answer_0(rid, ENOMEM);140 return;141 }142 143 async_data_write_finalize(callid, cwd, len);144 cwd[len] = '\0';145 146 ipc_answer_0(rid, EOK);147 }148 117 149 118 /** Receive a call setting pathname of the program to execute. … … 158 127 char *name_buf; 159 128 160 if (! async_data_write_receive(&callid, &len)) {129 if (!ipc_data_write_receive(&callid, &len)) { 161 130 ipc_answer_0(callid, EINVAL); 162 131 ipc_answer_0(rid, EINVAL); … … 171 140 } 172 141 173 async_data_write_finalize(callid, name_buf, len);142 ipc_data_write_finalize(callid, name_buf, len); 174 143 ipc_answer_0(rid, EOK); 175 144 … … 195 164 int n; 196 165 197 if (! async_data_write_receive(&callid, &buf_size)) {166 if (!ipc_data_write_receive(&callid, &buf_size)) { 198 167 ipc_answer_0(callid, EINVAL); 199 168 ipc_answer_0(rid, EINVAL); … … 218 187 } 219 188 220 async_data_write_finalize(callid, arg_buf, buf_size);189 ipc_data_write_finalize(callid, arg_buf, buf_size); 221 190 222 191 arg_buf[buf_size] = '\0'; … … 270 239 ipc_callid_t callid; 271 240 size_t buf_size; 272 if (! async_data_write_receive(&callid, &buf_size)) {241 if (!ipc_data_write_receive(&callid, &buf_size)) { 273 242 ipc_answer_0(callid, EINVAL); 274 243 ipc_answer_0(rid, EINVAL); … … 299 268 } 300 269 301 async_data_write_finalize(callid, fil_buf, buf_size);270 ipc_data_write_finalize(callid, fil_buf, buf_size); 302 271 303 272 int count = buf_size / sizeof(fdi_node_t); … … 343 312 344 313 elf_create_pcb(&prog_info, &pcb); 345 346 pcb.cwd = cwd;347 314 348 315 pcb.argc = argc; … … 439 406 case LOADER_GET_TASKID: 440 407 ldr_get_taskid(callid, &call); 441 continue;442 case LOADER_SET_CWD:443 ldr_set_cwd(callid, &call);444 408 continue; 445 409 case LOADER_SET_PATHNAME:
Note:
See TracChangeset
for help on using the changeset viewer.