Changeset ed5367b in mainline for uspace/app/sysctl/main.c
- Timestamp:
- 2019-08-07T10:01:13Z (5 years ago)
- Children:
- a097c50
- Parents:
- 68ae40a
- git-author:
- Michal Koutný <xm.koutny+hos@…> (2015-11-05 01:52:07)
- git-committer:
- Matthieu Riolo <matthieu.riolo@…> (2019-08-07 10:01:13)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/sysctl/main.c
r68ae40a red5367b 37 37 #include <stdlib.h> 38 38 #include <str.h> 39 #include <str_error.h> 39 40 #include <sysman/ctl.h> 40 41 … … 91 92 continue; 92 93 fail: 93 printf(" -- unit skipped due to IPC error (%i) --\n", rc); 94 printf(" -- unit skipped due to IPC error (%s) --\n", 95 str_error(rc)); 96 } 97 98 return 0; 99 } 100 101 static int stop(int argc, char *argv[]) 102 { 103 unit_handle_t handle; 104 char *unit_name = argv[1]; 105 106 int rc = sysman_unit_handle(unit_name, &handle); 107 if (rc != EOK) { 108 printf("Cannot obtain handle for unit '%s' (%s).\n", 109 unit_name, str_error(rc)); 110 return rc; 111 } 112 113 rc = sysman_unit_stop(handle, IPC_FLAG_BLOCKING); 114 if (rc != EOK) { 115 printf("Error when stopping unit '%s' handle (%s).\n", 116 unit_name, str_error(rc)); 117 return rc; 94 118 } 95 119 … … 99 123 command_t commands[] = { 100 124 { "list-units", 0, &list_units }, 125 { "stop", 1, &stop }, 101 126 { 0 } 102 127 };
Note:
See TracChangeset
for help on using the changeset viewer.