From patchwork Fri Jan 1 20:20:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 562047 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id A7396140A98 for ; Sat, 2 Jan 2016 07:20:43 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b=aAUJBVLJ; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id; q=dns; s= default; b=V1Ej2VDzg1xyiwYOwjX75o48ep1KXsVBMou14+K8LbUiMgvQtnZfQ kH4KR9DS4bM+ejZ4xnizAKkzqxjepXlbcK/O/hNYlWK1sr8QwNxX28sG0PogScSD djqIqqcPF+wQL94ImFv2LW9bHDR/U9AX0lo+MfJirEUrfW7UBojXF4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id; s=default; bh=yM1FGIlweUjLjFQ0F5MCJn2qxzs=; b=aAUJBVLJy3t+RccTbaLVo3YUvdfA JP+3Pqd92A0HXFv/4k+buCZ3fEdPWysmdD19Hn5Bwr+ZLcTLijn8Mf70BhNFXtQ6 ATn1q/gwBwWAsoIUSFWBgb9G7WXw5lTQxoapz9WX6qYNJAUgMB9eEuNZ4H0sfnuI wGLmbah0K6kGs7I= Received: (qmail 124900 invoked by alias); 1 Jan 2016 20:20:36 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 124889 invoked by uid 89); 1 Jan 2016 20:20:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1061, ldv@altlinux.org, D*altlinux.org, sk:ldvalt X-HELO: mail-qk0-f172.google.com X-Received: by 10.55.41.138 with SMTP id p10mr99135322qkp.18.1451679631950; Fri, 01 Jan 2016 12:20:31 -0800 (PST) From: Khem Raj To: libc-alpha@sourceware.org Cc: Khem Raj Subject: [PATCH] argp: Use fwrite_unlocked instead of __fxprintf when !_LIBC Date: Fri, 1 Jan 2016 20:20:26 +0000 Message-Id: <1451679626-28351-1-git-send-email-raj.khem@gmail.com> __fxprintf is not available when argp is built outside libc Signed-off-by: Khem Raj --- ChangeLog | 5 +++++ argp/argp-fmtstream.c | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index 51a055c..0bfb1fd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2016-01-01 Khem Raj + + * argp/argp-fmtstream.c (__argp_fmtstream_free): Use fwrite_unlocked + instead of __fxprintf when _LIBC is undefined. + 2015-12-30 Dmitry V. Levin [BZ #19408] diff --git a/argp/argp-fmtstream.c b/argp/argp-fmtstream.c index 2b845e0..f8de40e 100644 --- a/argp/argp-fmtstream.c +++ b/argp/argp-fmtstream.c @@ -100,7 +100,11 @@ __argp_fmtstream_free (argp_fmtstream_t fs) __argp_fmtstream_update (fs); if (fs->p > fs->buf) { +#ifdef _LIBC __fxprintf (fs->stream, "%.*s", (int) (fs->p - fs->buf), fs->buf); +#else + fwrite_unlocked (fs->buf, 1, fs->p - fs->buf, fs->stream); +#endif } free (fs->buf); free (fs);