On 6/12/2013 8:03 PM, Ira Weiny wrote:

This seems like 2 different patches to me.

> Signed-off-by: Ira Weiny <ira.we...@intel.com>
> ---
>  src/ibstat.c |    9 ++-------
>  1 files changed, 2 insertions(+), 7 deletions(-)
> 
> diff --git a/src/ibstat.c b/src/ibstat.c
> index 665bb0a..1ef27f2 100644
> --- a/src/ibstat.c
> +++ b/src/ibstat.c
> @@ -314,7 +314,8 @@ int main(int argc, char *argv[])
>               if (i >= n)
>                       IBPANIC("'%s' IB device can't be found", argv[0]);
>  
> -             strncpy(names[i], argv[0], sizeof names[i]);
> +             strncpy(names[0], argv[0], sizeof(names[0])-1);
> +             names[0][sizeof(names[0])-1] = '\0';
>               n = 1;
>       }
>  
> @@ -324,12 +325,6 @@ int main(int argc, char *argv[])
>               return 0;
>       }
>  
> -     if (!list_only && argc) {

I think I see the issue. Rather than eliminate this if clause, I think
the line above should be:

        if (!list_only && argc > 1) {

so that this properly handles the case when the port option is supplied.

-- Hal

> -             if (ca_stat(argv[0], dev_port, short_format) < 0)
> -                     IBPANIC("stat of IB device '%s' failed", argv[0]);
> -             return 0;
> -     }
> -
>       for (i = 0; i < n; i++) {
>               if (list_only)
>                       printf("%s\n", names[i]);

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to