Changes in uspace/app/devctl/devctl.c [5c769d54:cb500a2] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/devctl/devctl.c
r5c769d54 rcb500a2 35 35 #include <devman.h> 36 36 #include <errno.h> 37 #include <io/table.h>38 37 #include <stdbool.h> 39 38 #include <stdio.h> 40 39 #include <stdlib.h> 41 40 #include <str_error.h> 41 #include <sys/typefmt.h> 42 42 43 43 #define NAME "devctl" … … 206 206 size_t ndevs; 207 207 size_t i; 208 table_t *table = NULL;209 208 int rc; 210 209 … … 212 211 if (rc != EOK) 213 212 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");223 213 224 214 for (i = 0; i < ndrvs; i++) { … … 237 227 sstate = drv_state_str(state); 238 228 239 table_printf(table, "%s\t" "%zu\t" "%s\n", drv_name, ndevs, sstate);229 printf("%-11s %3zu %s\n", sstate, ndevs, drv_name); 240 230 skip: 241 231 free(devs); 242 232 } 243 244 rc = table_print_out(table, stdout);245 if (rc != EOK)246 printf("Error printing driver table.\n");247 out:248 233 free(drvs); 249 table_destroy(table); 250 251 return rc; 234 235 return EOK; 252 236 } 253 237
Note:
See TracChangeset
for help on using the changeset viewer.