1998-10-29 Ulrich Drepper <drepper@cygnus.com>
+ * stdio-common/vfprintf.c (vfprintf): Fix the remaining premature
+ returns without cleaning up the lock.
+
* sysdeps/unix/sysv/linux/ttyname.c (ttyname): Keep Linux 2.0
kernels in mind when reading /proc/self/fd/FD.
* sysdeps/unix/sysv/linux/ttyname_r.c (__ttyname_r): Likewise.
# define PAD(Padchar) \
if (width > 0) \
{ ssize_t __res = __printf_pad (s, (Padchar), width); \
- if (__res == -1) return -1; \
+ if (__res == -1) \
+ { \
+ done = -1; \
+ goto all_done; \
+ } \
done += __res; }
# endif
#else
# define PAD(Padchar) \
if (width > 0) \
{ ssize_t __res = __wprintf_pad (s, (Padchar), width); \
- if (__res == -1) return -1; \
+ if (__res == -1) \
+ { \
+ done = -1; \
+ goto all_done; \
+ } \
done += __res; }
# endif
#endif
{ \
register const int outc = (Ch); \
if (PUTC (outc, s) == EOF) \
- return -1; \
+ { \
+ done = -1; \
+ goto all_done; \
+ } \
else \
++done; \
} \
do \
{ \
if ((size_t) PUT (s, (String), (Len)) != (size_t) (Len)) \
- return -1; \
+ { \
+ done = -1; \
+ goto all_done; \
+ } \
done += (Len); \
} \
while (0)
} \
\
if (function_done < 0) \
- /* Error in print handler. */ \
- return -1; \
+ { \
+ /* Error in print handler. */ \
+ done = -1; \
+ goto all_done; \
+ } \
\
done += function_done; \
} \
} \
\
if (function_done < 0) \
- /* Error in print handler. */ \
- return -1; \
+ { \
+ /* Error in print handler. */ \
+ done = -1; \
+ goto all_done; \
+ } \
\
done += function_done; \
} \
memset (&mbstate, '\0', sizeof (mbstate_t)); \
len = __wcsrtombs (NULL, &s2, 0, &mbstate); \
if (len == (size_t) -1) \
- /* Illegal wide-character string. */ \
- return -1; \
+ { \
+ /* Illegal wide-character string. */ \
+ done = -1; \
+ goto all_done; \
+ } \
\
assert (__mbsinit (&mbstate)); \
s2 = (const wchar_t *) string; \