public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: chrubis@suse.cz
To: Jan Stancek <jstancek@redhat.com>
Cc: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH v2 1/2] add tst_get_unused_port()
Date: Tue, 11 Mar 2014 16:24:35 +0100	[thread overview]
Message-ID: <20140311152435.GE10778@rei> (raw)
In-Reply-To: <2618bd2ff004c79412ab2045f9a1d6c9f8afccec.1394461554.git.jstancek@redhat.com>

Hi!
> Returns unused port number for specified domain/type.
> 
> Signed-off-by: Jan Stancek <jstancek@redhat.com>
> ---
>  include/test.h |    7 +++++
>  lib/tst_net.c  |   80 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 87 insertions(+), 0 deletions(-)
>  create mode 100644 lib/tst_net.c
> 
> diff --git a/include/test.h b/include/test.h
> index 81fca3e..49a0f47 100644
> --- a/include/test.h
> +++ b/include/test.h
> @@ -288,6 +288,13 @@ int tst_fill_file(const char *path, char pattern, size_t bs, size_t bcount);
>  uid_t tst_get_unused_uid(void);
>  gid_t tst_get_unused_gid(void);
>  
> +/* lib/tst_net.c
> + *
> + * Return unused port
> + */
> +unsigned short tst_get_unused_port(unsigned short family, int type,
> +	void (cleanup_fn)(void));

Just am minor nit to the API. Most of the tst_ functions as well as
SAFE_MACROS() have cleanup callback as first parameter. Let's be
consistent with that.

-- 
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-11 15:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-07 11:39 [LTP] [PATCH 0/2] do not pick free/unused port by chance Jan Stancek
2014-03-07 11:39 ` [LTP] [PATCH 1/2] add tst_get_unused_port() Jan Stancek
2014-03-09 23:40   ` Mike Frysinger
2014-03-10 14:22   ` [LTP] (no subject) Jan Stancek
2014-03-10 14:28   ` [LTP] [PATCH v2 1/2] add tst_get_unused_port() Jan Stancek
2014-03-11 15:24     ` chrubis [this message]
2014-03-07 11:39 ` [LTP] [PATCH 2/2] do not pick free/unused port by chance Jan Stancek

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=20140311152435.GE10778@rei \
    --to=chrubis@suse.cz \
    --cc=jstancek@redhat.com \
    --cc=ltp-list@lists.sourceforge.net \
    /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