From: Khem Raj Date: Fri, 1 Jan 2016 20:20:26 +0000 (+0000) Subject: argp: Use fwrite_unlocked instead of __fxprintf when !_LIBC X-Git-Tag: glibc-2.23~78 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=45c4f3665aaa63cab148cc9cc96fa07c666c1c38;p=thirdparty%2Fglibc.git argp: Use fwrite_unlocked instead of __fxprintf when !_LIBC __fxprintf is not available when argp is built outside libc. gnulib has the same logic already. --- diff --git a/ChangeLog b/ChangeLog index 7dc2a942a8c..67f21816bfe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2016-01-07 Khem Raj + + * argp/argp-fmtstream.c (__argp_fmtstream_free): Use fwrite_unlocked + instead of __fxprintf when _LIBC is undefined. + 2016-01-07 Marko Myllynen * catgets/test-gencat.sh: Remove space after shebang. diff --git a/argp/argp-fmtstream.c b/argp/argp-fmtstream.c index 982db4e7c86..d951a962e3d 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);