diff options
Diffstat (limited to 'usr/src/lib/libc/port/print/wprintf.c')
-rw-r--r-- | usr/src/lib/libc/port/print/wprintf.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/usr/src/lib/libc/port/print/wprintf.c b/usr/src/lib/libc/port/print/wprintf.c index 4cdfe715fa..dc7d207766 100644 --- a/usr/src/lib/libc/port/print/wprintf.c +++ b/usr/src/lib/libc/port/print/wprintf.c @@ -23,8 +23,11 @@ * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* + * Copyright 2010 Nexenta Systems, Inc. All rights reserved. + * Use is subject to license terms. + */ -#pragma ident "%Z%%M% %I% %E% SMI" #include "lint.h" #include "file64.h" @@ -63,11 +66,8 @@ wprintf(const wchar_t *format, ...) va_start(ap, format); FLOCKFILE(lk, stdout); - if (_set_orientation_wide(stdout, NULL, NULL, 0) == -1) { - errno = EBADF; - FUNLOCKFILE(lk); - return (EOF); - } + if (GET_NO_MODE(stdout)) + _setorientation(stdout, _WC_MODE); if (!(stdout->_flag & _IOWRT)) { /* if no write flag */ @@ -109,11 +109,8 @@ fwprintf(FILE *iop, const wchar_t *format, ...) FLOCKFILE(lk, iop); - if (_set_orientation_wide(iop, NULL, NULL, 0) == -1) { - errno = EBADF; - FUNLOCKFILE(lk); - return (EOF); - } + if (GET_NO_MODE(iop)) + _setorientation(iop, _WC_MODE); if (!(iop->_flag & _IOWRT)) { /* if no write flag */ |