fputws.c (177628ce757cf1a3f7d4b9a70dc4682d22e50ebc) fputws.c (86dc3a9ae223b112541b2ce4eee1f5de475b09b1)
1/*-
2 * Copyright (c) 2002-2004 Tim J. Robbins.
3 * All rights reserved.
4 *
5 * Copyright (c) 2011 The FreeBSD Foundation
6 * All rights reserved.
7 * Portions of this software were developed by David Chisnall
8 * under sponsorship from the FreeBSD Foundation.

--- 47 unchanged lines hidden (view full) ---

56
57 FLOCKFILE(fp);
58 ORIENT(fp, 1);
59 if (prepwrite(fp) != 0)
60 goto error;
61 uio.uio_iov = &iov;
62 uio.uio_iovcnt = 1;
63 iov.iov_base = buf;
1/*-
2 * Copyright (c) 2002-2004 Tim J. Robbins.
3 * All rights reserved.
4 *
5 * Copyright (c) 2011 The FreeBSD Foundation
6 * All rights reserved.
7 * Portions of this software were developed by David Chisnall
8 * under sponsorship from the FreeBSD Foundation.

--- 47 unchanged lines hidden (view full) ---

56
57 FLOCKFILE(fp);
58 ORIENT(fp, 1);
59 if (prepwrite(fp) != 0)
60 goto error;
61 uio.uio_iov = &iov;
62 uio.uio_iovcnt = 1;
63 iov.iov_base = buf;
64 wsp = ws;
64 do {
65 do {
65 wsp = ws;
66 nbytes = l->__wcsnrtombs(buf, &wsp, SIZE_T_MAX, sizeof(buf),
67 &fp->_mbstate);
68 if (nbytes == (size_t)-1)
69 goto error;
70 iov.iov_len = uio.uio_resid = nbytes;
71 if (__sfvwrite(fp, &uio) != 0)
72 goto error;
73 } while (wsp != NULL);

--- 13 unchanged lines hidden ---
66 nbytes = l->__wcsnrtombs(buf, &wsp, SIZE_T_MAX, sizeof(buf),
67 &fp->_mbstate);
68 if (nbytes == (size_t)-1)
69 goto error;
70 iov.iov_len = uio.uio_resid = nbytes;
71 if (__sfvwrite(fp, &uio) != 0)
72 goto error;
73 } while (wsp != NULL);

--- 13 unchanged lines hidden ---