Changeset 8fab3f6 in mainline for uspace/srv/sysman/connection_ctl.c
- Timestamp:
- 2019-08-17T13:50:05Z (6 years ago)
- Children:
- 31ef7c1
- Parents:
- 504d103
- git-author:
- Michal Koutný <xm.koutny+hos@…> (2015-12-04 17:21:21)
- git-committer:
- Matthieu Riolo <matthieu.riolo@…> (2019-08-17 13:50:05)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/sysman/connection_ctl.c
r504d103 r8fab3f6 138 138 } 139 139 140 static void sysman_unit_stop(ipc_callid_t iid, ipc_call_t *icall) 140 static void sysman_unit_operation(ipc_callid_t iid, ipc_call_t *icall, 141 unit_state_t state) 141 142 { 142 143 sysarg_t retval; … … 144 145 unit_handle_t handle = IPC_GET_ARG1(*icall); 145 146 int flags = IPC_GET_ARG2(*icall); 146 sysman_log(LVL_DEBUG2, "%s(%i, %x )", __func__, handle, flags);147 sysman_log(LVL_DEBUG2, "%s(%i, %x, %i)", __func__, handle, flags, state); 147 148 148 149 unit_t *unit = repo_find_unit_by_handle(handle); … … 153 154 154 155 if (!(flags & IPC_FLAG_BLOCKING)) { 155 retval = sysman_run_job(unit, STATE_STOPPED, NULL, NULL);156 retval = sysman_run_job(unit, state, NULL, NULL); 156 157 goto answer; 157 158 } … … 162 163 goto answer; 163 164 } 164 retval = sysman_run_job(unit, STATE_STOPPED, &answer_callback,165 retval = sysman_run_job(unit, state, &answer_callback, 165 166 iid_ptr); 166 167 if (retval != EOK) { … … 173 174 answer: 174 175 async_answer_0(iid, retval); 176 } 177 178 static void sysman_unit_start(ipc_callid_t iid, ipc_call_t *icall) 179 { 180 sysman_unit_operation(iid, icall, STATE_STARTED); 181 } 182 183 static void sysman_unit_stop(ipc_callid_t iid, ipc_call_t *icall) 184 { 185 sysman_unit_operation(iid, icall, STATE_STOPPED); 175 186 } 176 187 … … 289 300 sysman_unit_start_by_name(callid, &call); 290 301 break; 302 case SYSMAN_CTL_UNIT_START: 303 sysman_unit_start(callid, &call); 304 break; 291 305 case SYSMAN_CTL_UNIT_STOP: 292 306 sysman_unit_stop(callid, &call);
Note:
See TracChangeset
for help on using the changeset viewer.