From patchwork Mon Nov 1 19:02:23 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jes Sorensen X-Patchwork-Id: 69828 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 6C034B70CC for ; Tue, 2 Nov 2010 06:06:38 +1100 (EST) Received: from localhost ([127.0.0.1]:46720 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PCzi4-0002Qk-3q for incoming@patchwork.ozlabs.org; Mon, 01 Nov 2010 15:06:24 -0400 Received: from [140.186.70.92] (port=40725 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PCzeF-0000As-FF for qemu-devel@nongnu.org; Mon, 01 Nov 2010 15:02:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PCzeE-0008OU-53 for qemu-devel@nongnu.org; Mon, 01 Nov 2010 15:02:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:21949) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PCzeD-0008OO-U0 for qemu-devel@nongnu.org; Mon, 01 Nov 2010 15:02:26 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oA1J2NDs005769 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 1 Nov 2010 15:02:24 -0400 Received: from red-feather.bos.redhat.com (dhcp-100-18-67.bos.redhat.com [10.16.18.67]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id oA1J2NUx025098 for ; Mon, 1 Nov 2010 15:02:23 -0400 From: Jes.Sorensen@redhat.com To: qemu-devel@nongnu.org Date: Mon, 1 Nov 2010 20:02:23 +0100 Message-Id: <1288638143-15227-1-git-send-email-Jes.Sorensen@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Subject: [Qemu-devel] [PATCH 1/1] Fold send_all() wrapper unix_write() into one function X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Jes Sorensen The current send_all() wrapper for POSIX calls does nothing but call unix_write(). Merge them to simplify the code. Signed-off-by: Jes Sorensen --- qemu-char.c | 8 ++------ 1 files changed, 2 insertions(+), 6 deletions(-) diff --git a/qemu-char.c b/qemu-char.c index 6d2dce7..88997f9 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -508,9 +508,10 @@ int send_all(int fd, const void *buf, int len1) #else -static int unix_write(int fd, const uint8_t *buf, int len1) +int send_all(int fd, const void *_buf, int len1) { int ret, len; + const uint8_t *buf = _buf; len = len1; while (len > 0) { @@ -527,11 +528,6 @@ static int unix_write(int fd, const uint8_t *buf, int len1) } return len1 - len; } - -int send_all(int fd, const void *buf, int len1) -{ - return unix_write(fd, buf, len1); -} #endif /* !_WIN32 */ #ifndef _WIN32