Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/stdio/putc.c')
-rw-r--r--newlib/libc/stdio/putc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/newlib/libc/stdio/putc.c b/newlib/libc/stdio/putc.c
index 6a410e216..925341939 100644
--- a/newlib/libc/stdio/putc.c
+++ b/newlib/libc/stdio/putc.c
@@ -84,6 +84,8 @@ _putc_r (struct _reent *ptr,
{
int result;
CHECK_INIT (ptr, fp);
+ if (ORIENT (fp, -1) != -1)
+ return EOF;
_newlib_flockfile_start (fp);
result = __sputc_r (ptr, c, fp);
_newlib_flockfile_end (fp);
@@ -100,6 +102,8 @@ putc (int c,
struct _reent *reent = _REENT;
CHECK_INIT (reent, fp);
+ if (ORIENT (fp, -1) != -1)
+ return EOF;
_newlib_flockfile_start (fp);
result = __sputc_r (reent, c, fp);
_newlib_flockfile_end (fp);