[Stgt-devel] [PATCH] stgt: avoid confusing debug message
FUJITA Tomonori
fujita.tomonori
Sat Jan 20 14:50:18 CET 2007
From: Pete Wyckoff <pw at osc.edu>
Subject: [Stgt-devel] [PATCH] stgt: avoid confusing debug message
Date: Fri, 19 Jan 2007 10:54:08 -0500
> Do not print errno in debug message when read returns 0.
Too verbose?
> Rewrote the logic a bit too so it is easier to follow.
Yeah. Merged.
> Signed-off-by: Pete Wyckoff <pw at osc.edu>
> ---
>
> Index: usr/iscsi/iscsid.c
> ===================================================================
> --- usr/iscsi/iscsid.c (revision 766)
> +++ usr/iscsi/iscsid.c (working copy)
> @@ -1520,12 +1520,18 @@ static void iscsi_rx_handler(int fd, str
> case IOSTATE_READ_AHS_DATA:
> read_again:
> res = conn->tp->ep_read(fd, conn->rx_buffer, conn->rx_size);
> - if (res <= 0) {
> - if (res == 0 || (errno != EINTR && errno != EAGAIN)) {
> + if (res == 0) {
> + conn->state = STATE_CLOSE;
> + break;
> + } else if (res < 0) {
> + if (errno == EINTR)
> + goto read_again;
> + else if (errno == EAGAIN)
> + break;
> + else {
> conn->state = STATE_CLOSE;
> dprintf("%d %d, %m\n", res, errno);
> - } else if (errno == EINTR)
> - goto read_again;
> + }
> break;
> }
> conn->rx_size -= res;
> _______________________________________________
> Stgt-devel mailing list
> Stgt-devel at lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/stgt-devel
>
More information about the stgt
mailing list