multipath: fix multipath -l <devmap> without output
PATCH 1/1 multipath: fix multipath -l <devmap> without output
Currently, the multipath -l <devmap> output is empty, and an error is printed to syslog:
# ./multipath -l mpatha
# # echo $?
1 # tail /var/log/messages
...
... multipath: mpatha: can't get udev deviceThat's due to dev_type not being initialized, and incorrectly evaluated. So, initialize it to DEV_NONE, which is verified/reset by get_dev_type().
Now there's actual output and no error in syslog:
# ./multipath -l mpatha
mpatha (3600a0b800011e95c000055d855167d1c) dm-0 IBM,1815 FAStT
... # echo $?
0Signed-off-by Mauricio Faria de Oliveira <[email protected]>
(tested on '2613ce0 Bump version code to 0.6.2')
--- multipath/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
multipath/main.c +1 -1
@@ -511,7 +511,7 @@ main (int argc, char *argv[])extern int optind;int r =1 ;enum mpath_cmds cmd =CMD_CREATE ; -enum devtypes dev_type; +enum devtypes dev_type =DEV_NONE ;char *dev =NULL ;struct config *conf;
Signature · 1 line
1.8.3.1
Merged.
Thanks.
Quoted 49 lines · Mauricio Faria de Oliveira
Currently, the multipath -l <devmap> output is empty, and an error is printed to syslog:
# ./multipath -l mpatha ## echo $? 1# tail /var/log/messages ... ... multipath: mpatha: can't get udev deviceThat's due to
dev_typenot being initialized, and incorrectly evaluated. So, initialize it toDEV_NONE, which is verified/reset byget_dev_type().Now there's actual output and no error in syslog:
# ./multipath -l mpatha mpatha (3600a0b800011e95c000055d855167d1c) dm-0 IBM,1815 FAStT ...# echo $? 0Signed-off-by Mauricio Faria de Oliveira <[email protected]>(tested on '2613ce0 Bump version code to 0.6.2')
--- multipath/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)multipath/main.c +1
-2@@ -511,7 +511,7 @@ main (int argc, char *argv[])extern int optind;int r =1 ;enum mpath_cmds cmd =CMD_CREATE ; -enum devtypes dev_type; +enum devtypes dev_type =DEV_NONE ;char *dev =NULL ;struct config *conf; --1.8.3.1