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