From patchwork Fri Oct 15 14:41:45 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jes Sorensen X-Patchwork-Id: 67964 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 C0903B70D6 for ; Sat, 16 Oct 2010 01:43:17 +1100 (EST) Received: from localhost ([127.0.0.1]:54430 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P6lUm-0003w1-Uc for incoming@patchwork.ozlabs.org; Fri, 15 Oct 2010 10:42:56 -0400 Received: from [140.186.70.92] (port=34071 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P6lTn-0003tO-0t for qemu-devel@nongnu.org; Fri, 15 Oct 2010 10:41:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P6lTi-00018x-9V for qemu-devel@nongnu.org; Fri, 15 Oct 2010 10:41:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51603) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P6lTi-00018Z-39 for qemu-devel@nongnu.org; Fri, 15 Oct 2010 10:41:50 -0400 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o9FEfmvL023082 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 15 Oct 2010 10:41:48 -0400 Received: from localhost6.localdomain6 (ovpn-113-85.phx2.redhat.com [10.3.113.85]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o9FEfl2J002118 for ; Fri, 15 Oct 2010 10:41:48 -0400 From: Jes.Sorensen@redhat.com To: qemu-devel@nongnu.org Date: Fri, 15 Oct 2010 16:41:45 +0200 Message-Id: <1287153705-19242-1-git-send-email-Jes.Sorensen@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 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