public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: chrubis@suse.cz
To: Alexey Kodanev <alexey.kodanev@oracle.com>
Cc: vasily.isaenko@oracle.com, ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH] tools/apicmd: add tst_get_unused_port
Date: Tue, 18 Mar 2014 13:17:49 +0100	[thread overview]
Message-ID: <20140318121748.GA12070@rei> (raw)
In-Reply-To: <1395140489-15791-1-git-send-email-alexey.kodanev@oracle.com>

Hi!
> +#include <sys/socket.h>
>  #include <stdio.h>
>  #include <string.h>
>  #include <stdlib.h>
> @@ -289,6 +290,40 @@ void apicmd_kvercmp2(int argc, char *argv[])
>  	exit(exit_value);
>  }
>  
> +struct param_pair {
> +	char *cmd;
> +	int value;
> +};
> +
> +unsigned short apicmd_get_unused_port(int argc, char *argv[])
> +{
> +	if (argc != 3)
> +		goto err;
> +
> +	const struct param_pair params[][3] = {
> +		{{ "ipv4", AF_INET }, { "ipv6", AF_INET6 }, { 0, 0 }},
                                                              ^
					I would rather see NULL here.

Because I'm not 100% sure that the automatic cast will do the right
thing on all implementations.

Otherwise it's fine.

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

      reply	other threads:[~2014-03-18 12:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-18 11:01 [LTP] [PATCH] tools/apicmd: add tst_get_unused_port Alexey Kodanev
2014-03-18 12:17 ` chrubis [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140318121748.GA12070@rei \
    --to=chrubis@suse.cz \
    --cc=alexey.kodanev@oracle.com \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=vasily.isaenko@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox