From patchwork Thu Jun 4 13:41:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yousong Zhou X-Patchwork-Id: 480746 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id A23601401DA for ; Thu, 4 Jun 2015 23:56:54 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=x0+GPdnZ; dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 0067328C0D3; Thu, 4 Jun 2015 15:52:37 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id E067528C0AC for ; Thu, 4 Jun 2015 15:52:02 +0200 (CEST) X-policyd-weight: using cached result; rate: -8.5 Received: from mail-pd0-f182.google.com (mail-pd0-f182.google.com [209.85.192.182]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Thu, 4 Jun 2015 15:51:59 +0200 (CEST) Received: by pdbqa5 with SMTP id qa5so31579480pdb.0 for ; Thu, 04 Jun 2015 06:53:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=CptALs388ANU8WUwUbORSe5jOfV0ApBmWEv4BKopSLg=; b=x0+GPdnZeYF+b/4SXARvxcG0pnu0j4CR9JtMkBbgepvP32LDdFCAYzGLn4/gRECW4z iW9xFFhvAtS7YUq7MVOg4VCf4oP2cv9r2GOnmqAxn5I20bjYml0lyxBEQRnAt6F3pubb 1Ku2dPRimUEyYZjtkPd3AfYuZjt1pp1n3YNlm74UxOcbqllbhYmU7gLE+HOHx+PSX1C0 Efg1R3GcS4K/zkEB4v9e1O8S9MtK5pTRcEU6Gd1jNWE8uBF4Xyy2IWf+pYCSf1hSx64w AKM2PjSJS0fO5v3t+QD8MUj+/eNRakp6gzdO/M2FpzKTzJZg+wybRTKkhNxPmxEnl356 o/HQ== X-Received: by 10.66.136.78 with SMTP id py14mr4469679pab.1.1433426012898; Thu, 04 Jun 2015 06:53:32 -0700 (PDT) Received: from debian.corp.sankuai.com ([103.29.140.58]) by mx.google.com with ESMTPSA id qt4sm3885676pbc.86.2015.06.04.06.53.31 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Jun 2015 06:53:32 -0700 (PDT) From: Yousong Zhou To: nbd@openwrt.org Date: Thu, 4 Jun 2015 21:41:41 +0800 Message-Id: <1433425302-26448-5-git-send-email-yszhou4tech@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1433425302-26448-1-git-send-email-yszhou4tech@gmail.com> References: <1433425302-26448-1-git-send-email-yszhou4tech@gmail.com> Cc: openwrt-devel@lists.openwrt.org Subject: [OpenWrt-Devel] [PATCH 4/5] ustream-fd: readability change. X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" Signed-off-by: Yousong Zhou --- ustream-fd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ustream-fd.c b/ustream-fd.c index bc44d4a..daef499 100644 --- a/ustream-fd.c +++ b/ustream-fd.c @@ -119,7 +119,8 @@ static bool __ustream_fd_poll(struct ustream_fd *sf, unsigned int events) ustream_fd_read_pending(sf, &more); if (events & ULOOP_WRITE) { - if (ustream_write_pending(s)) + bool no_more = ustream_write_pending(s); + if (no_more) ustream_fd_set_uloop(s, false); }