[multipathd] small fixes
authorChristophe Varoqui <root@xa-s05.(none)>
Fri, 11 Nov 2005 09:39:05 +0000 (10:39 +0100)
committerChristophe Varoqui <root@xa-s05.(none)>
Fri, 11 Nov 2005 09:39:05 +0000 (10:39 +0100)
There was a spot where multipathd's reply length forgot to count the NULL,
and I noticed that the way domap go rewritten, the dry-run option doesn't
print out the maps.

This patch fixes both.

Benjamin Marzinski, Redhat

multipath/main.c
multipathd/cli.c

index 02a2279..ba5d7a0 100644 (file)
@@ -626,8 +626,10 @@ domap (struct multipath * mpp)
        /*
         * last chance to quit before touching the devmaps
         */
-       if (conf->dry_run)
+       if (conf->dry_run) {
+               print_mp(mpp);
                return 0;
+       }
 
        switch (mpp->action) {
        case ACT_NOTHING:
index 561b1b1..044deef 100644 (file)
@@ -314,7 +314,7 @@ parse_cmd (char * cmd, char ** reply, int * len, void * data)
 
        if (!cmdvec) {
                *reply = genhelp_handler();
-               *len = strlen(*reply);
+               *len = strlen(*reply) + 1;
                return 0;
        }