1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00

* include/stdio.h (__fxprintf): Remove wfmt argument.

* stdio-common/fxprintf.c: Include assert.h, ctype.h and wchar.h.
	(__fxprintf): Remove wfmt argument, create wfmt format string on
	the fly from fmt.
	* argp/argp-fmtstream.c: Adjust all __fxprintf callers.
	* argp/argp-help.c: Likewise.
	* assert/assert-perr.c: Likewise.
	* assert/assert.c: Likewise.
	* gmon/gmon.c: Likewise.
	* inet/rcmd.c: Likewise.
	* malloc/obstack.c: Likewise.
	* misc/error.c: Likewise.
	* misc/getpass.c: Likewise.
	* posix/getopt.c: Likewise.
	* resolv/res_hconf.c: Likewise.
	* stdio-common/perror.c: Likewise.
	* stdio-common/psignal.c: Likewise.
	* stdlib/fmtmsg.c: Likewise.
	* sunrpc/auth_unix.c: Likewise.
	* sunrpc/clnt_perr.c: Likewise.
	* sunrpc/clnt_tcp.c: Likewise.
	* sunrpc/clnt_udp.c: Likewise.
	* sunrpc/clnt_unix.c: Likewise.
	* sunrpc/svc_simple.c: Likewise.
	* sunrpc/svc_tcp.c: Likewise.
	* sunrpc/svc_udp.c: Likewise.
	* sunrpc/svc_unix.c: Likewise.
	* sunrpc/xdr.c: Likewise.
	* sunrpc/xdr_array.c: Likewise.
	* sunrpc/xdr_rec.c: Likewise.
	* sunrpc/xdr_ref.c: Likewise.
	* sysdeps/generic/wordexp.c: Likewise.
This commit is contained in:
Ulrich Drepper
2005-07-20 17:51:14 +00:00
parent df6f89692f
commit 8a259a2310
31 changed files with 125 additions and 97 deletions

View File

@ -1,3 +1,38 @@
2005-07-20 Jakub Jelinek <jakub@redhat.com>
* include/stdio.h (__fxprintf): Remove wfmt argument.
* stdio-common/fxprintf.c: Include assert.h, ctype.h and wchar.h.
(__fxprintf): Remove wfmt argument, create wfmt format string on
the fly from fmt.
* argp/argp-fmtstream.c: Adjust all __fxprintf callers.
* argp/argp-help.c: Likewise.
* assert/assert-perr.c: Likewise.
* assert/assert.c: Likewise.
* gmon/gmon.c: Likewise.
* inet/rcmd.c: Likewise.
* malloc/obstack.c: Likewise.
* misc/error.c: Likewise.
* misc/getpass.c: Likewise.
* posix/getopt.c: Likewise.
* resolv/res_hconf.c: Likewise.
* stdio-common/perror.c: Likewise.
* stdio-common/psignal.c: Likewise.
* stdlib/fmtmsg.c: Likewise.
* sunrpc/auth_unix.c: Likewise.
* sunrpc/clnt_perr.c: Likewise.
* sunrpc/clnt_tcp.c: Likewise.
* sunrpc/clnt_udp.c: Likewise.
* sunrpc/clnt_unix.c: Likewise.
* sunrpc/svc_simple.c: Likewise.
* sunrpc/svc_tcp.c: Likewise.
* sunrpc/svc_udp.c: Likewise.
* sunrpc/svc_unix.c: Likewise.
* sunrpc/xdr.c: Likewise.
* sunrpc/xdr_array.c: Likewise.
* sunrpc/xdr_rec.c: Likewise.
* sunrpc/xdr_ref.c: Likewise.
* sysdeps/generic/wordexp.c: Likewise.
2005-07-20 Ulrich Drepper <drepper@redhat.com> 2005-07-20 Ulrich Drepper <drepper@redhat.com>
* wcsmbs/bits/wchar2.h: Add definitions for wcrtomb, mbsrtowcs, * wcsmbs/bits/wchar2.h: Add definitions for wcrtomb, mbsrtowcs,

View File

@ -102,8 +102,7 @@ __argp_fmtstream_free (argp_fmtstream_t fs)
if (fs->p > fs->buf) if (fs->p > fs->buf)
{ {
#ifdef USE_IN_LIBIO #ifdef USE_IN_LIBIO
__fxprintf (fs->stream, "%.*s", L"%.*s", __fxprintf (fs->stream, "%.*s", (int) (fs->p - fs->buf), fs->buf);
(int) (fs->p - fs->buf), fs->buf);
#else #else
fwrite_unlocked (fs->buf, 1, fs->p - fs->buf, fs->stream); fwrite_unlocked (fs->buf, 1, fs->p - fs->buf, fs->stream);
#endif #endif
@ -292,7 +291,7 @@ __argp_fmtstream_update (argp_fmtstream_t fs)
/* Output the first line so we can use the space. */ /* Output the first line so we can use the space. */
{ {
#ifdef _LIBC #ifdef _LIBC
__fxprintf (fs->stream, "%.*s\n", L"%.*s\n", __fxprintf (fs->stream, "%.*s\n",
(int) (nl - fs->buf), fs->buf); (int) (nl - fs->buf), fs->buf);
#else #else
if (nl > fs->buf) if (nl > fs->buf)
@ -359,8 +358,7 @@ __argp_fmtstream_ensure (struct argp_fmtstream *fs, size_t amount)
__argp_fmtstream_update (fs); __argp_fmtstream_update (fs);
#ifdef _LIBC #ifdef _LIBC
__fxprintf (fs->stream, "%.*s", L"%.*s", __fxprintf (fs->stream, "%.*s", (int) (fs->p - fs->buf), fs->buf);
(int) (fs->p - fs->buf), fs->buf);
wrote = fs->p - fs->buf; wrote = fs->p - fs->buf;
#else #else
wrote = fwrite_unlocked (fs->buf, 1, fs->p - fs->buf, fs->stream); wrote = fwrite_unlocked (fs->buf, 1, fs->p - fs->buf, fs->stream);

View File

@ -1769,7 +1769,7 @@ __argp_error (const struct argp_state *state, const char *fmt, ...)
if (__asprintf (&buf, fmt, ap) < 0) if (__asprintf (&buf, fmt, ap) < 0)
buf = NULL; buf = NULL;
__fxprintf (stream, "%s: %s\n", L"%s: %s\n", __fxprintf (stream, "%s: %s\n",
state ? state->name : __argp_short_program_name (), buf); state ? state->name : __argp_short_program_name (), buf);
free (buf); free (buf);
@ -1821,7 +1821,7 @@ __argp_failure (const struct argp_state *state, int status, int errnum,
#endif #endif
#ifdef _LIBC #ifdef _LIBC
__fxprintf (stream, "%s", L"%s", __fxprintf (stream, "%s",
state ? state->name : __argp_short_program_name ()); state ? state->name : __argp_short_program_name ());
#else #else
fputs_unlocked (state ? state->name : __argp_short_program_name (), fputs_unlocked (state ? state->name : __argp_short_program_name (),
@ -1839,7 +1839,7 @@ __argp_failure (const struct argp_state *state, int status, int errnum,
if (__asprintf (&buf, fmt, ap) < 0) if (__asprintf (&buf, fmt, ap) < 0)
buf = NULL; buf = NULL;
__fxprintf (stream, ": %s", L": %s", buf); __fxprintf (stream, ": %s", buf);
free (buf); free (buf);
#else #else
@ -1857,7 +1857,7 @@ __argp_failure (const struct argp_state *state, int status, int errnum,
char buf[200]; char buf[200];
#ifdef _LIBC #ifdef _LIBC
__fxprintf (stream, ": %s", L": %s", __fxprintf (stream, ": %s",
__strerror_r (errnum, buf, sizeof (buf))); __strerror_r (errnum, buf, sizeof (buf)));
#else #else
putc_unlocked (':', stream); putc_unlocked (':', stream);

View File

@ -61,7 +61,7 @@ __assert_perror_fail (int errnum,
__strerror_r (errnum, errbuf, sizeof errbuf)) >= 0) __strerror_r (errnum, errbuf, sizeof errbuf)) >= 0)
{ {
/* Print the message. */ /* Print the message. */
(void) __fxprintf (NULL, "%s", L"%s", buf); (void) __fxprintf (NULL, "%s", buf);
(void) fflush (stderr); (void) fflush (stderr);
/* We have to free the buffer since the appplication might catch the /* We have to free the buffer since the appplication might catch the

View File

@ -61,7 +61,7 @@ __assert_fail (const char *assertion, const char *file, unsigned int line,
assertion) >= 0) assertion) >= 0)
{ {
/* Print the message. */ /* Print the message. */
(void) __fxprintf (NULL, "%s", L"%s", buf); (void) __fxprintf (NULL, "%s", buf);
(void) fflush (stderr); (void) fflush (stderr);
/* We have to free the buffer since the application might catch the /* We have to free the buffer since the application might catch the

View File

@ -344,7 +344,6 @@ write_gmon (void)
char buf[300]; char buf[300];
int errnum = errno; int errnum = errno;
__fxprintf (NULL, "_mcleanup: gmon.out: %s\n", __fxprintf (NULL, "_mcleanup: gmon.out: %s\n",
L"_mcleanup: gmon.out: %s\n",
__strerror_r (errnum, buf, sizeof buf)); __strerror_r (errnum, buf, sizeof buf));
return; return;
} }

View File

@ -79,8 +79,8 @@ extern int __ftrylockfile (FILE *__stream);
extern int __getc_unlocked (FILE *__fp); extern int __getc_unlocked (FILE *__fp);
extern wint_t __getwc_unlocked (FILE *__fp); extern wint_t __getwc_unlocked (FILE *__fp);
extern int __fxprintf (FILE *__fp, const char *__fmt, const wchar_t *__wfmt, extern int __fxprintf (FILE *__fp, const char *__fmt, ...)
...) __attribute__ ((__format__ (__printf__, 2, 4))); __attribute__ ((__format__ (__printf__, 2, 3)));
extern __const char *__const _sys_errlist_internal[] attribute_hidden; extern __const char *__const _sys_errlist_internal[] attribute_hidden;
extern int _sys_nerr_internal attribute_hidden; extern int _sys_nerr_internal attribute_hidden;

View File

@ -138,11 +138,9 @@ rcmd_af(ahost, rport, locuser, remuser, cmd, fd2p, af)
error = getaddrinfo(*ahost, num, &hints, &res); error = getaddrinfo(*ahost, num, &hints, &res);
if (error) { if (error) {
if (error == EAI_NONAME && *ahost != NULL) if (error == EAI_NONAME && *ahost != NULL)
__fxprintf(NULL, "%s: Unknown host\n", __fxprintf(NULL, "%s: Unknown host\n", *ahost);
L"%s: Unknown host\n", *ahost);
else else
__fxprintf(NULL, "rcmd: getaddrinfo: %s\n", __fxprintf(NULL, "rcmd: getaddrinfo: %s\n",
L"rcmd: getaddrinfo: %s\n",
gai_strerror(error)); gai_strerror(error));
return -1; return -1;
@ -155,7 +153,7 @@ rcmd_af(ahost, rport, locuser, remuser, cmd, fd2p, af)
free (ahostbuf); free (ahostbuf);
ahostbuf = strdup (res->ai_canonname); ahostbuf = strdup (res->ai_canonname);
if (ahostbuf == NULL) { if (ahostbuf == NULL) {
__fxprintf(NULL, "%s", L"%s", __fxprintf(NULL, "%s",
_("rcmd: Cannot allocate memory\n")); _("rcmd: Cannot allocate memory\n"));
return -1; return -1;
} }
@ -171,11 +169,10 @@ rcmd_af(ahost, rport, locuser, remuser, cmd, fd2p, af)
s = rresvport_af(&lport, ai->ai_family); s = rresvport_af(&lport, ai->ai_family);
if (s < 0) { if (s < 0) {
if (errno == EAGAIN) if (errno == EAGAIN)
__fxprintf(NULL, "%s", L"%s", _("\ __fxprintf(NULL, "%s", _("\
rcmd: socket: All ports in use\n")); rcmd: socket: All ports in use\n"));
else else
__fxprintf(NULL, "rcmd: socket: %m\n", __fxprintf(NULL, "rcmd: socket: %m\n");
L"rcmd: socket: %m\n");
__sigsetmask(oldmask); __sigsetmask(oldmask);
freeaddrinfo(res); freeaddrinfo(res);
@ -203,7 +200,7 @@ rcmd: socket: All ports in use\n"));
if (__asprintf (&buf, _("connect to address %s: "), if (__asprintf (&buf, _("connect to address %s: "),
paddr) >= 0) paddr) >= 0)
{ {
__fxprintf(NULL, "%s", L"%s", buf); __fxprintf(NULL, "%s", buf);
free (buf); free (buf);
} }
__set_errno (oerrno); __set_errno (oerrno);
@ -215,7 +212,7 @@ rcmd: socket: All ports in use\n"));
NI_NUMERICHOST); NI_NUMERICHOST);
if (__asprintf (&buf, _("Trying %s...\n"), paddr) >= 0) if (__asprintf (&buf, _("Trying %s...\n"), paddr) >= 0)
{ {
__fxprintf (NULL, "%s", L"%s", buf); __fxprintf (NULL, "%s", buf);
free (buf); free (buf);
} }
continue; continue;
@ -228,7 +225,7 @@ rcmd: socket: All ports in use\n"));
continue; continue;
} }
freeaddrinfo(res); freeaddrinfo(res);
(void)__fxprintf(NULL, "%s: %s\n", L"%s: %s\n", *ahost, (void)__fxprintf(NULL, "%s: %s\n", *ahost,
__strerror_r(errno, errbuf, sizeof (errbuf))); __strerror_r(errno, errbuf, sizeof (errbuf)));
__sigsetmask(oldmask); __sigsetmask(oldmask);
return -1; return -1;
@ -252,7 +249,7 @@ rcmd: socket: All ports in use\n"));
if (__asprintf (&buf, _("\ if (__asprintf (&buf, _("\
rcmd: write (setting up stderr): %m\n")) >= 0) rcmd: write (setting up stderr): %m\n")) >= 0)
{ {
__fxprintf(NULL, "%s", L"%s", buf); __fxprintf(NULL, "%s", buf);
free (buf); free (buf);
} }
(void)__close(s2); (void)__close(s2);
@ -271,7 +268,7 @@ rcmd: poll (setting up stderr): %m\n")) >= 0)
&& __asprintf(&buf, _("\ && __asprintf(&buf, _("\
poll: protocol failure in circuit setup\n")) >= 0)) poll: protocol failure in circuit setup\n")) >= 0))
{ {
__fxprintf (NULL, "%s", L"%s", buf); __fxprintf (NULL, "%s", buf);
free (buf); free (buf);
} }
(void)__close(s2); (void)__close(s2);
@ -292,8 +289,7 @@ poll: protocol failure in circuit setup\n")) >= 0))
} }
(void)__close(s2); (void)__close(s2);
if (s3 < 0) { if (s3 < 0) {
(void)__fxprintf(NULL, "rcmd: accept: %m\n", (void)__fxprintf(NULL, "rcmd: accept: %m\n");
L"rcmd: accept: %m\n");
lport = 0; lport = 0;
goto bad; goto bad;
} }
@ -305,7 +301,7 @@ poll: protocol failure in circuit setup\n")) >= 0))
if (__asprintf(&buf, _("\ if (__asprintf(&buf, _("\
socket: protocol failure in circuit setup\n")) >= 0) socket: protocol failure in circuit setup\n")) >= 0)
{ {
__fxprintf (NULL, "%s", L"%s", buf); __fxprintf (NULL, "%s", buf);
free (buf); free (buf);
} }
goto bad2; goto bad2;
@ -331,7 +327,7 @@ socket: protocol failure in circuit setup\n")) >= 0)
|| (n != 0 || (n != 0
&& __asprintf(&buf, "rcmd: %s: %m\n", *ahost) >= 0)) && __asprintf(&buf, "rcmd: %s: %m\n", *ahost) >= 0))
{ {
__fxprintf (NULL, "%s", L"%s", buf); __fxprintf (NULL, "%s", buf);
free (buf); free (buf);
} }
goto bad2; goto bad2;

View File

@ -410,7 +410,7 @@ print_and_abort (void)
happen because the "memory exhausted" message appears in other places happen because the "memory exhausted" message appears in other places
like this and the translation should be reused instead of creating like this and the translation should be reused instead of creating
a very similar string which requires a separate translation. */ a very similar string which requires a separate translation. */
(void) __fxprintf (NULL, "%s\n", L"%s\n", _("memory exhausted")); (void) __fxprintf (NULL, "%s\n", _("memory exhausted"));
exit (obstack_exit_failure); exit (obstack_exit_failure);
} }

View File

@ -158,7 +158,7 @@ print_errno_message (int errnum)
#endif #endif
#if _LIBC #if _LIBC
__fxprintf (NULL, ": %s", L": %s", s); __fxprintf (NULL, ": %s", s);
#else #else
fprintf (stderr, ": %s", s); fprintf (stderr, ": %s", s);
#endif #endif
@ -243,7 +243,7 @@ error_tail (int status, int errnum, const char *message, va_list args)
if (errnum) if (errnum)
print_errno_message (errnum); print_errno_message (errnum);
# if _LIBC # if _LIBC
__fxprintf (NULL, "\n", L"\n"); __fxprintf (NULL, "\n");
# else # else
putc ('\n', stderr); putc ('\n', stderr);
# endif # endif
@ -291,7 +291,7 @@ error (status, errnum, message, va_alist)
else else
{ {
#if _LIBC #if _LIBC
__fxprintf (NULL, "%s: ", L"%s: ", program_name); __fxprintf (NULL, "%s: ", program_name);
#else #else
fprintf (stderr, "%s: ", program_name); fprintf (stderr, "%s: ", program_name);
#endif #endif
@ -374,7 +374,7 @@ error_at_line (status, errnum, file_name, line_number, message, va_alist)
else else
{ {
#if _LIBC #if _LIBC
__fxprintf (NULL, "%s:", L"%s: ", program_name); __fxprintf (NULL, "%s:", program_name);
#else #else
fprintf (stderr, "%s:", program_name); fprintf (stderr, "%s:", program_name);
#endif #endif
@ -383,7 +383,7 @@ error_at_line (status, errnum, file_name, line_number, message, va_alist)
if (file_name != NULL) if (file_name != NULL)
{ {
#if _LIBC #if _LIBC
__fxprintf (NULL, "%s:%d: ", L"%s:%d: ", file_name, line_number); __fxprintf (NULL, "%s:%d: ", file_name, line_number);
#else #else
fprintf (stderr, "%s:%d: ", file_name, line_number); fprintf (stderr, "%s:%d: ", file_name, line_number);
#endif #endif

View File

@ -91,7 +91,7 @@ getpass (prompt)
tty_changed = 0; tty_changed = 0;
/* Write the prompt. */ /* Write the prompt. */
__fxprintf (out, "%s", L"%s", prompt); __fxprintf (out, "%s", prompt);
fflush_unlocked (out); fflush_unlocked (out);
/* Read the password. */ /* Read the password. */
@ -106,7 +106,7 @@ getpass (prompt)
buf[nread - 1] = '\0'; buf[nread - 1] = '\0';
if (tty_changed) if (tty_changed)
/* Write the newline that was not echoed. */ /* Write the newline that was not echoed. */
__fxprintf (out, "%c", L"%c", '\n'); __fxprintf (out, "\n");
} }
} }

View File

@ -576,7 +576,7 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
int old_flags2 = ((_IO_FILE *) stderr)->_flags2; int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
__fxprintf (NULL, "%s", L"%s", buf); __fxprintf (NULL, "%s", buf);
((_IO_FILE *) stderr)->_flags2 = old_flags2; ((_IO_FILE *) stderr)->_flags2 = old_flags2;
_IO_funlockfile (stderr); _IO_funlockfile (stderr);
@ -651,7 +651,7 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
((_IO_FILE *) stderr)->_flags2 ((_IO_FILE *) stderr)->_flags2
|= _IO_FLAGS2_NOTCANCEL; |= _IO_FLAGS2_NOTCANCEL;
__fxprintf (NULL, "%s", L"%s", buf); __fxprintf (NULL, "%s", buf);
((_IO_FILE *) stderr)->_flags2 = old_flags2; ((_IO_FILE *) stderr)->_flags2 = old_flags2;
_IO_funlockfile (stderr); _IO_funlockfile (stderr);
@ -688,7 +688,7 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
((_IO_FILE *) stderr)->_flags2 ((_IO_FILE *) stderr)->_flags2
|= _IO_FLAGS2_NOTCANCEL; |= _IO_FLAGS2_NOTCANCEL;
__fxprintf (NULL, "%s", L"%s", buf); __fxprintf (NULL, "%s", buf);
((_IO_FILE *) stderr)->_flags2 = old_flags2; ((_IO_FILE *) stderr)->_flags2 = old_flags2;
_IO_funlockfile (stderr); _IO_funlockfile (stderr);
@ -762,7 +762,7 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
int old_flags2 = ((_IO_FILE *) stderr)->_flags2; int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
__fxprintf (NULL, "%s", L"%s", buf); __fxprintf (NULL, "%s", buf);
((_IO_FILE *) stderr)->_flags2 = old_flags2; ((_IO_FILE *) stderr)->_flags2 = old_flags2;
_IO_funlockfile (stderr); _IO_funlockfile (stderr);
@ -825,7 +825,7 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
int old_flags2 = ((_IO_FILE *) stderr)->_flags2; int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
__fxprintf (NULL, "%s", L"%s", buf); __fxprintf (NULL, "%s", buf);
((_IO_FILE *) stderr)->_flags2 = old_flags2; ((_IO_FILE *) stderr)->_flags2 = old_flags2;
_IO_funlockfile (stderr); _IO_funlockfile (stderr);
@ -873,7 +873,7 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
int old_flags2 = ((_IO_FILE *) stderr)->_flags2; int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
__fxprintf (NULL, "%s", L"%s", buf); __fxprintf (NULL, "%s", buf);
((_IO_FILE *) stderr)->_flags2 = old_flags2; ((_IO_FILE *) stderr)->_flags2 = old_flags2;
_IO_funlockfile (stderr); _IO_funlockfile (stderr);
@ -942,7 +942,7 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
int old_flags2 = ((_IO_FILE *) stderr)->_flags2; int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
__fxprintf (NULL, "%s", L"%s", buf); __fxprintf (NULL, "%s", buf);
((_IO_FILE *) stderr)->_flags2 = old_flags2; ((_IO_FILE *) stderr)->_flags2 = old_flags2;
_IO_funlockfile (stderr); _IO_funlockfile (stderr);
@ -984,7 +984,7 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
((_IO_FILE *) stderr)->_flags2 ((_IO_FILE *) stderr)->_flags2
|= _IO_FLAGS2_NOTCANCEL; |= _IO_FLAGS2_NOTCANCEL;
__fxprintf (NULL, "%s", L"%s", buf); __fxprintf (NULL, "%s", buf);
((_IO_FILE *) stderr)->_flags2 = old_flags2; ((_IO_FILE *) stderr)->_flags2 = old_flags2;
_IO_funlockfile (stderr); _IO_funlockfile (stderr);
@ -1023,7 +1023,7 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
((_IO_FILE *) stderr)->_flags2 ((_IO_FILE *) stderr)->_flags2
|= _IO_FLAGS2_NOTCANCEL; |= _IO_FLAGS2_NOTCANCEL;
__fxprintf (NULL, "%s", L"%s", buf); __fxprintf (NULL, "%s", buf);
((_IO_FILE *) stderr)->_flags2 = old_flags2; ((_IO_FILE *) stderr)->_flags2 = old_flags2;
_IO_funlockfile (stderr); _IO_funlockfile (stderr);
@ -1094,7 +1094,7 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
int old_flags2 = ((_IO_FILE *) stderr)->_flags2; int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
__fxprintf (NULL, "%s", L"%s", buf); __fxprintf (NULL, "%s", buf);
((_IO_FILE *) stderr)->_flags2 = old_flags2; ((_IO_FILE *) stderr)->_flags2 = old_flags2;
_IO_funlockfile (stderr); _IO_funlockfile (stderr);

View File

@ -150,7 +150,7 @@ arg_service_list (const char *fname, int line_num, const char *args,
fname, line_num, start) < 0) fname, line_num, start) < 0)
return 0; return 0;
__fxprintf (NULL, "%s", L"%s", buf); __fxprintf (NULL, "%s", buf);
free (buf); free (buf);
return 0; return 0;
@ -164,7 +164,7 @@ arg_service_list (const char *fname, int line_num, const char *args,
fname, line_num, SERVICE_MAX) < 0) fname, line_num, SERVICE_MAX) < 0)
return 0; return 0;
__fxprintf (NULL, "%s", L"%s", buf); __fxprintf (NULL, "%s", buf);
free (buf); free (buf);
return 0; return 0;
@ -187,7 +187,7 @@ arg_service_list (const char *fname, int line_num, const char *args,
fname, line_num) < 0) fname, line_num) < 0)
return 0; return 0;
__fxprintf (NULL, "%s", L"%s", buf); __fxprintf (NULL, "%s", buf);
free (buf); free (buf);
return 0; return 0;
@ -223,7 +223,7 @@ arg_trimdomain_list (const char *fname, int line_num, const char *args,
fname, line_num, TRIMDOMAINS_MAX) < 0) fname, line_num, TRIMDOMAINS_MAX) < 0)
return 0; return 0;
__fxprintf (NULL, "%s", L"%s", buf); __fxprintf (NULL, "%s", buf);
free (buf); free (buf);
return 0; return 0;
@ -244,7 +244,7 @@ arg_trimdomain_list (const char *fname, int line_num, const char *args,
fname, line_num) < 0) fname, line_num) < 0)
return 0; return 0;
__fxprintf (NULL, "%s", L"%s", buf); __fxprintf (NULL, "%s", buf);
free (buf); free (buf);
return 0; return 0;
@ -302,7 +302,7 @@ arg_bool (const char *fname, int line_num, const char *args, unsigned flag)
fname, line_num, args) < 0) fname, line_num, args) < 0)
return 0; return 0;
__fxprintf (NULL, "%s", L"%s", buf); __fxprintf (NULL, "%s", buf);
free (buf); free (buf);
return 0; return 0;
@ -345,7 +345,7 @@ parse_line (const char *fname, int line_num, const char *str)
fname, line_num, start) < 0) fname, line_num, start) < 0)
return; return;
__fxprintf (NULL, "%s", L"%s", buf); __fxprintf (NULL, "%s", buf);
free (buf); free (buf);
return; return;
@ -370,7 +370,7 @@ parse_line (const char *fname, int line_num, const char *str)
fname, line_num, str) < 0) fname, line_num, str) < 0)
break; break;
__fxprintf (NULL, "%s", L"%s", buf); __fxprintf (NULL, "%s", buf);
free (buf); free (buf);
} }

View File

@ -17,22 +17,34 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */ 02111-1307 USA. */
#include <assert.h>
#include <ctype.h>
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>
#include <wchar.h>
int int
__fxprintf (FILE *fp, const char *fmt, const wchar_t *wfmt, ...) __fxprintf (FILE *fp, const char *fmt, ...)
{ {
if (fp == NULL) if (fp == NULL)
fp = stderr; fp = stderr;
va_list ap; va_list ap;
va_start (ap, wfmt); va_start (ap, fmt);
int res; int res;
if (_IO_fwide (fp, 0) > 0) if (_IO_fwide (fp, 0) > 0)
{
size_t len = strlen (fmt) + 1, i;
wchar_t wfmt[len];
for (i = 0; i < len; ++i)
{
assert (isascii (fmt[i]));
wfmt[i] = fmt[i];
}
res = __vfwprintf (fp, wfmt, ap); res = __vfwprintf (fp, wfmt, ap);
}
else else
res = _IO_vfprintf (fp, fmt, ap); res = _IO_vfprintf (fp, fmt, ap);

View File

@ -37,7 +37,7 @@ perror_internal (FILE *fp, const char *s, int errnum)
errstring = __strerror_r (errnum, buf, sizeof buf); errstring = __strerror_r (errnum, buf, sizeof buf);
(void) __fxprintf (fp, "%s%s%s\n", L"%s%s%s\n", s, colon, errstring); (void) __fxprintf (fp, "%s%s%s\n", s, colon, errstring);
} }

View File

@ -47,17 +47,16 @@ psignal (int sig, const char *s)
colon = ": "; colon = ": ";
if (sig >= 0 && sig < NSIG && (desc = INTUSE(_sys_siglist)[sig]) != NULL) if (sig >= 0 && sig < NSIG && (desc = INTUSE(_sys_siglist)[sig]) != NULL)
(void) __fxprintf (NULL, L"%s%s%s\n", "%s%s%s\n", s, colon, _(desc)); (void) __fxprintf (NULL, "%s%s%s\n", s, colon, _(desc));
else else
{ {
char *buf; char *buf;
if (__asprintf (&buf, _("%s%sUnknown signal %d\n"), s, colon, sig) < 0) if (__asprintf (&buf, _("%s%sUnknown signal %d\n"), s, colon, sig) < 0)
(void) __fxprintf (NULL, "%s%s%s\n", L"%s%s%s\n", (void) __fxprintf (NULL, "%s%s%s\n", s, colon, _("Unknown signal"));
s, colon, _("Unknown signal"));
else else
{ {
(void) __fxprintf (NULL, L"%s", "%s", buf); (void) __fxprintf (NULL, "%s", buf);
free (buf); free (buf);
} }

View File

@ -155,7 +155,6 @@ fmtmsg (long int classification, const char *label, int severity,
int do_tag = (print & tag_mask) && tag != MM_NULLTAG; int do_tag = (print & tag_mask) && tag != MM_NULLTAG;
if (__fxprintf (stderr, "%s%s%s%s%s%s%s%s%s%s\n", if (__fxprintf (stderr, "%s%s%s%s%s%s%s%s%s%s\n",
L"%s%s%s%s%s%s%s%s%s%s\n",
do_label ? label : "", do_label ? label : "",
do_label && (do_severity | do_text | do_action | do_tag) do_label && (do_severity | do_text | do_action | do_tag)
? ": " : "", ? ": " : "",

View File

@ -111,8 +111,7 @@ authunix_create (char *machname, uid_t uid, gid_t gid, int len,
if (auth == NULL || au == NULL) if (auth == NULL || au == NULL)
{ {
no_memory: no_memory:
(void) __fxprintf (NULL, "%s", L"%s", (void) __fxprintf (NULL, "%s", _("authunix_create: out of memory\n"));
_("authunix_create: out of memory\n"));
mem_free (auth, sizeof (*auth)); mem_free (auth, sizeof (*auth));
mem_free (au, sizeof (*au)); mem_free (au, sizeof (*au));
return NULL; return NULL;

View File

@ -155,7 +155,7 @@ libc_hidden_def (clnt_sperror)
void void
clnt_perror (CLIENT * rpch, const char *msg) clnt_perror (CLIENT * rpch, const char *msg)
{ {
(void) __fxprintf (NULL, "%s", L"%s", clnt_sperror (rpch, msg)); (void) __fxprintf (NULL, "%s", clnt_sperror (rpch, msg));
} }
libc_hidden_def (clnt_perror) libc_hidden_def (clnt_perror)
@ -284,7 +284,7 @@ libc_hidden_def (clnt_sperrno)
void void
clnt_perrno (enum clnt_stat num) clnt_perrno (enum clnt_stat num)
{ {
(void) __fxprintf (NULL, "%s", L"%s", clnt_sperrno (num)); (void) __fxprintf (NULL, "%s", clnt_sperrno (num));
} }
@ -327,7 +327,7 @@ libc_hidden_def (clnt_spcreateerror)
void void
clnt_pcreateerror (const char *msg) clnt_pcreateerror (const char *msg)
{ {
(void) __fxprintf (NULL, "%s", L"%s", clnt_spcreateerror (msg)); (void) __fxprintf (NULL, "%s", clnt_spcreateerror (msg));
} }
struct auth_errtab struct auth_errtab

View File

@ -128,8 +128,7 @@ clnttcp_create (struct sockaddr_in *raddr, u_long prog, u_long vers,
if (h == NULL || ct == NULL) if (h == NULL || ct == NULL)
{ {
struct rpc_createerr *ce = &get_rpc_createerr (); struct rpc_createerr *ce = &get_rpc_createerr ();
(void) __fxprintf (NULL, "%s", L"%s", (void) __fxprintf (NULL, "%s", _("clnttcp_create: out of memory\n"));
_("clnttcp_create: out of memory\n"));
ce->cf_stat = RPC_SYSTEMERROR; ce->cf_stat = RPC_SYSTEMERROR;
ce->cf_error.re_errno = ENOMEM; ce->cf_error.re_errno = ENOMEM;
goto fooy; goto fooy;

View File

@ -136,8 +136,7 @@ clntudp_bufcreate (struct sockaddr_in *raddr, u_long program, u_long version,
if (cl == NULL || cu == NULL) if (cl == NULL || cu == NULL)
{ {
struct rpc_createerr *ce = &get_rpc_createerr (); struct rpc_createerr *ce = &get_rpc_createerr ();
(void) __fxprintf (NULL, "%s", L"%s", (void) __fxprintf (NULL, "%s", _("clntudp_create: out of memory\n"));
_("clntudp_create: out of memory\n"));
ce->cf_stat = RPC_SYSTEMERROR; ce->cf_stat = RPC_SYSTEMERROR;
ce->cf_error.re_errno = ENOMEM; ce->cf_error.re_errno = ENOMEM;
goto fooy; goto fooy;

View File

@ -125,8 +125,7 @@ clntunix_create (struct sockaddr_un *raddr, u_long prog, u_long vers,
if (h == NULL || ct == NULL) if (h == NULL || ct == NULL)
{ {
struct rpc_createerr *ce = &get_rpc_createerr (); struct rpc_createerr *ce = &get_rpc_createerr ();
(void) __fxprintf (NULL, "%s", L"%s", (void) __fxprintf (NULL, "%s", _("clntunix_create: out of memory\n"));
_("clntunix_create: out of memory\n"));
ce->cf_stat = RPC_SYSTEMERROR; ce->cf_stat = RPC_SYSTEMERROR;
ce->cf_error.re_errno = ENOMEM; ce->cf_error.re_errno = ENOMEM;
goto fooy; goto fooy;

View File

@ -125,7 +125,7 @@ registerrpc (u_long prognum, u_long versnum, u_long procnum,
err_out: err_out:
if (buf == NULL) if (buf == NULL)
return -1; return -1;
(void) __fxprintf (NULL, "%s", L"%s", buf); (void) __fxprintf (NULL, "%s", buf);
free (buf); free (buf);
return -1; return -1;
} }
@ -184,7 +184,7 @@ universal (struct svc_req *rqstp, SVCXPRT *transp_l)
err_out2: err_out2:
if (buf == NULL) if (buf == NULL)
exit (1); exit (1);
__fxprintf (NULL, "%s", L"%s", buf); __fxprintf (NULL, "%s", buf);
free (buf); free (buf);
exit (1); exit (1);
} }

View File

@ -176,8 +176,7 @@ svctcp_create (int sock, u_int sendsize, u_int recvsize)
xprt = (SVCXPRT *) mem_alloc (sizeof (SVCXPRT)); xprt = (SVCXPRT *) mem_alloc (sizeof (SVCXPRT));
if (r == NULL || xprt == NULL) if (r == NULL || xprt == NULL)
{ {
(void) __fxprintf (NULL, "%s", L"%s", (void) __fxprintf (NULL, "%s", _("svctcp_create: out of memory\n"));
_("svctcp_create: out of memory\n"));
mem_free (r, sizeof (*r)); mem_free (r, sizeof (*r));
mem_free (xprt, sizeof (SVCXPRT)); mem_free (xprt, sizeof (SVCXPRT));
return NULL; return NULL;
@ -215,7 +214,7 @@ makefd_xprt (int fd, u_int sendsize, u_int recvsize)
cd = (struct tcp_conn *) mem_alloc (sizeof (struct tcp_conn)); cd = (struct tcp_conn *) mem_alloc (sizeof (struct tcp_conn));
if (xprt == (SVCXPRT *) NULL || cd == NULL) if (xprt == (SVCXPRT *) NULL || cd == NULL)
{ {
(void) __fxprintf (NULL, "%s", L"%s", (void) __fxprintf (NULL, "%s",
_("svc_tcp: makefd_xprt: out of memory\n")); _("svc_tcp: makefd_xprt: out of memory\n"));
mem_free (xprt, sizeof (SVCXPRT)); mem_free (xprt, sizeof (SVCXPRT));
mem_free (cd, sizeof (struct tcp_conn)); mem_free (cd, sizeof (struct tcp_conn));

View File

@ -149,8 +149,7 @@ svcudp_bufcreate (sock, sendsz, recvsz)
buf = mem_alloc (((MAX (sendsz, recvsz) + 3) / 4) * 4); buf = mem_alloc (((MAX (sendsz, recvsz) + 3) / 4) * 4);
if (xprt == NULL || su == NULL || buf == NULL) if (xprt == NULL || su == NULL || buf == NULL)
{ {
(void) __fxprintf (NULL, "%s", L"%s", (void) __fxprintf (NULL, "%s", _("svcudp_create: out of memory\n"));
_("svcudp_create: out of memory\n"));
mem_free (xprt, sizeof (SVCXPRT)); mem_free (xprt, sizeof (SVCXPRT));
mem_free (su, sizeof (*su)); mem_free (su, sizeof (*su));
mem_free (buf, ((MAX (sendsz, recvsz) + 3) / 4) * 4); mem_free (buf, ((MAX (sendsz, recvsz) + 3) / 4) * 4);
@ -172,7 +171,7 @@ svcudp_bufcreate (sock, sendsz, recvsz)
+ sizeof(struct cmsghdr) + sizeof (struct in_pktinfo)) + sizeof(struct cmsghdr) + sizeof (struct in_pktinfo))
> sizeof (xprt->xp_pad)) > sizeof (xprt->xp_pad))
{ {
(void) __fxprintf (NULL,"%s", L"%s", _("\ (void) __fxprintf (NULL,"%s", _("\
svcudp_create: xp_pad is too small for IP_PKTINFO\n")); svcudp_create: xp_pad is too small for IP_PKTINFO\n"));
return NULL; return NULL;
} }
@ -402,7 +401,7 @@ svcudp_destroy (xprt)
#define SPARSENESS 4 /* 75% sparse */ #define SPARSENESS 4 /* 75% sparse */
#define CACHE_PERROR(msg) \ #define CACHE_PERROR(msg) \
(void) __fxprintf(NULL, "%s\n", L"%s\n", msg) (void) __fxprintf(NULL, "%s\n", msg)
#define ALLOC(type, size) \ #define ALLOC(type, size) \
(type *) mem_alloc((unsigned) (sizeof(type) * (size))) (type *) mem_alloc((unsigned) (sizeof(type) * (size)))

View File

@ -173,7 +173,7 @@ svcunix_create (int sock, u_int sendsize, u_int recvsize, char *path)
xprt = (SVCXPRT *) mem_alloc (sizeof (SVCXPRT)); xprt = (SVCXPRT *) mem_alloc (sizeof (SVCXPRT));
if (r == NULL || xprt == NULL) if (r == NULL || xprt == NULL)
{ {
__fxprintf (NULL, "%s", L"%s", _("svcunix_create: out of memory\n")); __fxprintf (NULL, "%s", _("svcunix_create: out of memory\n"));
mem_free (r, sizeof (*r)); mem_free (r, sizeof (*r));
mem_free (xprt, sizeof (SVCXPRT)); mem_free (xprt, sizeof (SVCXPRT));
return NULL; return NULL;
@ -211,7 +211,7 @@ makefd_xprt (int fd, u_int sendsize, u_int recvsize)
cd = (struct unix_conn *) mem_alloc (sizeof (struct unix_conn)); cd = (struct unix_conn *) mem_alloc (sizeof (struct unix_conn));
if (xprt == (SVCXPRT *) NULL || cd == (struct unix_conn *) NULL) if (xprt == (SVCXPRT *) NULL || cd == (struct unix_conn *) NULL)
{ {
(void) __fxprintf (NULL, "%s", L"%s", (void) __fxprintf (NULL, "%s",
_("svc_unix: makefd_xprt: out of memory\n")); _("svc_unix: makefd_xprt: out of memory\n"));
mem_free (xprt, sizeof (SVCXPRT)); mem_free (xprt, sizeof (SVCXPRT));
mem_free (cd, sizeof (struct unix_conn)); mem_free (cd, sizeof (struct unix_conn));

View File

@ -563,8 +563,7 @@ xdr_bytes (xdrs, cpp, sizep, maxsize)
} }
if (sp == NULL) if (sp == NULL)
{ {
(void) __fxprintf (NULL, "%s", L"%s", (void) __fxprintf (NULL, "%s", _("xdr_bytes: out of memory\n"));
_("xdr_bytes: out of memory\n"));
return FALSE; return FALSE;
} }
/* fall into ... */ /* fall into ... */
@ -716,8 +715,7 @@ xdr_string (xdrs, cpp, maxsize)
*cpp = sp = (char *) mem_alloc (nodesize); *cpp = sp = (char *) mem_alloc (nodesize);
if (sp == NULL) if (sp == NULL)
{ {
(void) __fxprintf (NULL, "%s", L"%s", (void) __fxprintf (NULL, "%s", _("xdr_string: out of memory\n"));
_("xdr_string: out of memory\n"));
return FALSE; return FALSE;
} }
sp[size] = 0; sp[size] = 0;

View File

@ -105,8 +105,7 @@ xdr_array (xdrs, addrp, sizep, maxsize, elsize, elproc)
*addrp = target = mem_alloc (nodesize); *addrp = target = mem_alloc (nodesize);
if (target == NULL) if (target == NULL)
{ {
(void) __fxprintf (NULL, "%s", L"%s", (void) __fxprintf (NULL, "%s", _("xdr_array: out of memory\n"));
_("xdr_array: out of memory\n"));
return FALSE; return FALSE;
} }
__bzero (target, nodesize); __bzero (target, nodesize);

View File

@ -153,8 +153,7 @@ xdrrec_create (XDR *xdrs, u_int sendsize,
if (rstrm == NULL || buf == NULL) if (rstrm == NULL || buf == NULL)
{ {
(void) __fxprintf (NULL, "%s", L"%s", (void) __fxprintf (NULL, "%s", _("xdrrec_create: out of memory\n"));
_("xdrrec_create: out of memory\n"));
mem_free (rstrm, sizeof (RECSTREAM)); mem_free (rstrm, sizeof (RECSTREAM));
mem_free (buf, sendsize + recvsize + BYTES_PER_XDR_UNIT); mem_free (buf, sendsize + recvsize + BYTES_PER_XDR_UNIT);
/* /*

View File

@ -82,7 +82,7 @@ xdr_reference (xdrs, pp, size, proc)
*pp = loc = (caddr_t) mem_alloc (size); *pp = loc = (caddr_t) mem_alloc (size);
if (loc == NULL) if (loc == NULL)
{ {
(void) __fxprintf (NULL, "%s", L"%s", (void) __fxprintf (NULL, "%s",
_("xdr_reference: out of memory\n")); _("xdr_reference: out of memory\n"));
return FALSE; return FALSE;
} }

View File

@ -1798,7 +1798,7 @@ envsubst:
if (str[0] == '\0') if (str[0] == '\0')
str = _("parameter null or not set"); str = _("parameter null or not set");
__fxprintf (NULL, "%s: %s\n", L"%s: %s\n", env, str); __fxprintf (NULL, "%s: %s\n", env, str);
} }
if (free_value) if (free_value)