Changeset 5c769d54 in mainline for uspace/app/devctl/devctl.c
- Timestamp:
- 2017-09-22T17:06:08Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- bd1745f
- Parents:
- 207d5da
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/devctl/devctl.c
r207d5da r5c769d54 35 35 #include <devman.h> 36 36 #include <errno.h> 37 #include <io/table.h> 37 38 #include <stdbool.h> 38 39 #include <stdio.h> … … 205 206 size_t ndevs; 206 207 size_t i; 208 table_t *table = NULL; 207 209 int rc; 208 210 … … 210 212 if (rc != EOK) 211 213 return rc; 214 215 rc = table_create(&table); 216 if (rc != EOK) { 217 assert(rc == ENOMEM); 218 goto out; 219 } 220 221 table_header_row(table); 222 table_printf(table, "Driver\t" "Devs\t" "State\n"); 212 223 213 224 for (i = 0; i < ndrvs; i++) { … … 226 237 sstate = drv_state_str(state); 227 238 228 printf("%-11s %3zu %s\n", sstate, ndevs, drv_name);239 table_printf(table, "%s\t" "%zu\t" "%s\n", drv_name, ndevs, sstate); 229 240 skip: 230 241 free(devs); 231 242 } 243 244 rc = table_print_out(table, stdout); 245 if (rc != EOK) 246 printf("Error printing driver table.\n"); 247 out: 232 248 free(drvs); 233 234 return EOK; 249 table_destroy(table); 250 251 return rc; 235 252 } 236 253
Note:
See TracChangeset
for help on using the changeset viewer.