diff options
author | mananth <mananth> | 2003-10-15 12:44:29 +0000 |
---|---|---|
committer | mananth <mananth> | 2003-10-15 12:44:29 +0000 |
commit | 4b726c94f0fcc8d16278fb4b20fab6ca8a4c177d (patch) | |
tree | 52ba99d4898c428653d0e2645354772d2713d96f | |
parent | 200c5e5f1eb40aa6ca4ba1bfbb5fcc376b38b4a6 (diff) | |
download | sysfsutils-4b726c94f0fcc8d16278fb4b20fab6ca8a4c177d.tar.gz |
Change the way systool lists block devices (./systool --> no params)
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | cmd/systool.c | 13 |
2 files changed, 14 insertions, 6 deletions
@@ -1,4 +1,7 @@ +10/10/2003 - Ananth Mavinakayanahalli <ananth@in.ibm.com> + * Modified the way systool displayed block devices + 10/09/2003 - Ananth Mavinakayanahalli <ananth@in.ibm.com> * Updated docs/libsysfs.txt * Fixed warning in cmd/names.c @@ -10,7 +13,7 @@ 10/07/2003 - Ananth Mavinakayanahalli <ananth@in.ibm.com> * Miscellaneous changes - renaming of some functions, etc - + 10/06/2003 - Ananth Mavinakayanahalli <ananth@in.ibm.com> * Pruned "test" routines * Corrected pci name decode in cmds @@ -43,7 +46,7 @@ * Added sysfs_change_attribute_value() - a wrapper for sysfs_write_attribute() * Simplified sysfs_get_device_attr() - + 09/16/2003 - Ananth Mavinakayanahalli <ananth@in.ibm.com> * Patch sysfs_close_driver() so as not to segfault when during dlist shifting. diff --git a/cmd/systool.c b/cmd/systool.c index 6fe1361..ad4de42 100644 --- a/cmd/systool.c +++ b/cmd/systool.c @@ -620,8 +620,8 @@ int show_default_info(void) { unsigned char subsys[SYSFS_NAME_LEN]; struct dlist *list = NULL; - char *cur = NULL; - int retval = 0; + unsigned char *cur = NULL; + int retval = 0, i; strcpy(subsys, SYSFS_BUS_DIR); list = sysfs_open_subsystem_list(subsys); @@ -654,8 +654,13 @@ int show_default_info(void) list = sysfs_open_subsystem_list(subsys); if (list != NULL) { fprintf(stdout, "Supported sysfs block devices:\n"); - dlist_for_each_data(list, cur, char) - fprintf(stdout, "\t%s\n", cur); + i = 1; + dlist_for_each_data(list, cur, char) { + fprintf(stdout, "\t%s", cur); + if (!(i++ % 8)) + fprintf(stdout, "\n"); + } + fprintf(stdout, "\n"); } sysfs_close_list(list); |