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
[email protected]

------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to