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 v7] network: tcp_fastopen: add TCP Fast Open test
Date: Thu, 10 Apr 2014 17:39:41 +0200 [thread overview]
Message-ID: <20140410153941.GA25778@rei> (raw)
In-Reply-To: <1395845334-8976-1-git-send-email-alexey.kodanev@oracle.com>
Hi!
> +static int sock_recv_poll(int fd, char *buf, int buf_size, int *offset)
> +{
> + struct pollfd pfd;
> + pfd.fd = fd;
> + pfd.events = POLLIN;
> + int len = -1;
> + while (1) {
> + errno = 0;
> + int ret = poll(&pfd, 1, wait_timeout / 1000);
> + if (ret == -1) {
> + if (errno == EINTR)
> + continue;
> + break;
> + }
> +
> + if (ret == 0) {
> + errno = ETIME;
> + break;
> + }
> +
> + if (ret != 1 || !(pfd.revents & POLLIN))
> + break;
> +
> + errno = 0;
> + len = recv(fd, buf + *offset,
> + buf_size - *offset, MSG_DONTWAIT);
> +
> + if (len == -1 && errno == EINTR)
> + continue;
> + else
> + break;
> + }
> +
> + return len;
> +}
You pass the offset as a pointer but do not modify the value. Forgot to
change it when the code around changed?
...
> +static void check_opt(const char *name, char *arg, int *val, int lim)
> +{
> + if (arg) {
> + if (sscanf(arg, "%i", val) != 1)
> + tst_brkm(TBROK, NULL, "-%s option arg is not a number",
> + name);
> + if (clients_num < lim)
^
*val
> + tst_brkm(TBROK, NULL, "-%s option arg is less than %d",
> + name, lim);
> + }
> +}
> +
> +static void check_opt_l(const char *name, char *arg, long *val, long lim)
> +{
> + if (arg) {
> + if (sscanf(arg, "%ld", val) != 1)
> + tst_brkm(TBROK, NULL, "-%s option arg is not a number",
> + name);
> + if (clients_num < lim)
^
*val
> + tst_brkm(TBROK, NULL, "-%s option arg is less than %ld",
> + name, lim);
> + }
> +}
> +
The rest looks fine.
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
next prev parent reply other threads:[~2014-04-10 15:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-26 14:48 [LTP] [PATCH v7] network: tcp_fastopen: add TCP Fast Open test Alexey Kodanev
2014-04-10 15:39 ` chrubis [this message]
[not found] ` <534BDF7A.5080409@oracle.com>
2014-04-14 15:20 ` chrubis
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=20140410153941.GA25778@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