Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Khem Raj authored and Mike Frysinger committed Jan 7, 2016
1 parent 48d0341 commit 45c4f36
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
@@ -1,3 +1,8 @@
2016-01-07 Khem Raj <raj.khem@gmail.com>

* argp/argp-fmtstream.c (__argp_fmtstream_free): Use fwrite_unlocked
instead of __fxprintf when _LIBC is undefined.

2016-01-07 Marko Myllynen <myllynen@redhat.com> 2016-01-07 Marko Myllynen <myllynen@redhat.com>


* catgets/test-gencat.sh: Remove space after shebang. * catgets/test-gencat.sh: Remove space after shebang.
Expand Down
4 changes: 4 additions & 0 deletions argp/argp-fmtstream.c
Expand Up @@ -100,7 +100,11 @@ __argp_fmtstream_free (argp_fmtstream_t fs)
__argp_fmtstream_update (fs); __argp_fmtstream_update (fs);
if (fs->p > fs->buf) if (fs->p > fs->buf)
{ {
#ifdef _LIBC
__fxprintf (fs->stream, "%.*s", (int) (fs->p - fs->buf), fs->buf); __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->buf);
free (fs); free (fs);
Expand Down

0 comments on commit 45c4f36

Please sign in to comment.