diff options
author | Karel Zak | 2018-10-12 12:48:42 +0200 |
---|---|---|
committer | Karel Zak | 2018-12-07 12:32:57 +0100 |
commit | a0a76f42650fb4bf6773349b14b52be5b52339d7 (patch) | |
tree | 0b47156a7cd5c43e7427261b39ee345ab499a8b4 /misc-utils/lsblk.c | |
parent | lsblk: rename reset_lsblk_device() to reset_device() (diff) | |
download | kernel-qcow2-util-linux-a0a76f42650fb4bf6773349b14b52be5b52339d7.tar.gz kernel-qcow2-util-linux-a0a76f42650fb4bf6773349b14b52be5b52339d7.tar.xz kernel-qcow2-util-linux-a0a76f42650fb4bf6773349b14b52be5b52339d7.zip |
lsblk: properly initialize structs
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'misc-utils/lsblk.c')
-rw-r--r-- | misc-utils/lsblk.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/misc-utils/lsblk.c b/misc-utils/lsblk.c index e5785dd9a..e8710f3d6 100644 --- a/misc-utils/lsblk.c +++ b/misc-utils/lsblk.c @@ -1081,6 +1081,7 @@ static int set_device(struct lsblk_device *dev, return 0; } + static int process_blkdev(struct lsblk_device *dev, struct lsblk_device *parent, int do_partitions, const char *part_name); @@ -1092,7 +1093,7 @@ static int list_partitions(struct lsblk_device *wholedisk_dev, struct lsblk_devi { DIR *dir; struct dirent *d; - struct lsblk_device part_dev = { NULL }; + struct lsblk_device part_dev = { .parent = NULL }; int r = -1; assert(wholedisk_dev); @@ -1195,7 +1196,7 @@ static int list_deps(struct lsblk_device *dev) { DIR *dir; struct dirent *d; - struct lsblk_device dep = { NULL }; + struct lsblk_device dep = { .parent = NULL }; const char *depname; assert(dev); @@ -1256,7 +1257,7 @@ static int iterate_block_devices(void) { DIR *dir; struct dirent *d; - struct lsblk_device dev = { NULL }; + struct lsblk_device dev = { .parent = NULL }; struct path_cxt *pc = ul_new_path(_PATH_SYS_BLOCK); if (!pc) @@ -1299,7 +1300,7 @@ done: static int process_one_device(char *devname) { - struct lsblk_device parent = { NULL }, dev = { NULL }; + struct lsblk_device parent = { .parent = NULL }, dev = { .parent = NULL }; struct stat st; char buf[PATH_MAX + 1], *name = NULL, *diskname = NULL; dev_t disk = 0; |