Re: [PATCH] multipathd: fix issue in 'map $map getprstatus' reply

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/12/2016 11:30 PM, peng.liang5@xxxxxxxxxx wrote:
Thanks for your attention. I don't think it is necessary to do that.
Whatever returning 1 or ENOMEM it will reply "fail\n" and set the
returning to 1.

The executed code in uxsock_trigger as follows.
        if (r > 0) {
                if (r == ETIMEDOUT)
                        *reply = STRDUP("timeout\n");
                else
                        *reply = STRDUP("fail\n");
                *len = strlen(*reply) + 1;
                r = 1;
        }

Hello Peng,

Anyone who wants to verify your patch has to look up the numeric value of ETIMEDOUT to see whether or not the value of that constant is equal to one. So using "return 1" makes the source code harder to read than "return ENOMEM". Additionally, it is inconsistent from a stylistic point of view that the caller compares the return value with an E... error code and that the called function returns a numeric constant. So I would appreciate it very much if you would change "return 1" into "return ENOMEM" or any other symbolic E* error code of your preference.

Bart.

--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel



[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux