aboutsummaryrefslogtreecommitdiff
path: root/stdio-common
diff options
context:
space:
mode:
Diffstat (limited to 'stdio-common')
-rw-r--r--stdio-common/vfprintf.c7
-rw-r--r--stdio-common/vfscanf.c12
2 files changed, 14 insertions, 5 deletions
diff --git a/stdio-common/vfprintf.c b/stdio-common/vfprintf.c
index 85558a1574..a40acb75d4 100644
--- a/stdio-common/vfprintf.c
+++ b/stdio-common/vfprintf.c
@@ -1472,7 +1472,12 @@ do_positional:
all_done:
/* Unlock the stream. */
- __libc_cleanup_region_end (1);
+#ifdef USE_IN_LIBIO
+ _IO_funlockfile (s);
+#else
+ __funlockfile (s);
+#endif
+ __libc_cleanup_region_end (0);
return done;
}
diff --git a/stdio-common/vfscanf.c b/stdio-common/vfscanf.c
index 7666c87936..c1ff2690b7 100644
--- a/stdio-common/vfscanf.c
+++ b/stdio-common/vfscanf.c
@@ -100,7 +100,9 @@
# define LOCK_STREAM(S) \
__libc_cleanup_region_start ((void (*) (void *)) &_IO_funlockfile, (S)); \
_IO_flockfile (S)
-# define UNLOCK_STREAM __libc_cleanup_region_end (1)
+# define UNLOCK_STREAM(S) \
+ _IO_funlockfile (S); \
+ __libc_cleanup_region_end (0)
#else
# define ungetc(c, s) ((void) (c != EOF && --read_in), ungetc (c, s))
# define inchar() (c == EOF ? EOF \
@@ -143,12 +145,14 @@
# define flockfile(S) /* nothing */
# define funlockfile(S) /* nothing */
# define LOCK_STREAM(S)
-# define UNLOCK_STREAM
+# define UNLOCK_STREAM(S)
#else
# define LOCK_STREAM(S) \
__libc_cleanup_region_start (&__funlockfile, (S)); \
__flockfile (S)
-# define UNLOCK_STREAM __libc_cleanup_region_end (1)
+# define UNLOCK_STREAM(S) \
+ __funlockfile (S); \
+ __libc_cleanup_region_end (0)
#endif
#endif
@@ -1216,7 +1220,7 @@ __vfscanf (FILE *s, const char *format, va_list argptr)
}
/* Unlock stream. */
- UNLOCK_STREAM;
+ UNLOCK_STREAM (s);
return done;
}