This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] argp: Use fwrite_unlocked instead of __fxprintf when !_LIBC
- From: Khem Raj <raj dot khem at gmail dot com>
- To: libc-alpha at sourceware dot org
- Cc: Khem Raj <raj dot khem at gmail dot com>
- Date: Fri, 1 Jan 2016 20:20:26 +0000
- Subject: [PATCH] argp: Use fwrite_unlocked instead of __fxprintf when !_LIBC
- Authentication-results: sourceware.org; auth=none
__fxprintf is not available when argp is built outside libc
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
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 <raj.khem@gmail.com>
+
+ * argp/argp-fmtstream.c (__argp_fmtstream_free): Use fwrite_unlocked
+ instead of __fxprintf when _LIBC is undefined.
+
2015-12-30 Dmitry V. Levin <ldv@altlinux.org>
[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);
--
2.6.4