aboutsummaryrefslogtreecommitdiff
path: root/newlib
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2004-01-16 19:29:16 +0000
committerJeff Johnston <jjohnstn@redhat.com>2004-01-16 19:29:16 +0000
commit4af71a917cdd86d78e783fda9fe1cb197cfee36b (patch)
treef1fb49cbd0ac1edcb2404c068f5726658f3b968a /newlib
parent8e7014383b8dc99e3a804c530c31bde05511bd03 (diff)
downloadnewlib-4af71a917cdd86d78e783fda9fe1cb197cfee36b.zip
newlib-4af71a917cdd86d78e783fda9fe1cb197cfee36b.tar.gz
newlib-4af71a917cdd86d78e783fda9fe1cb197cfee36b.tar.bz2
2004-01-16 Thomas Pfaff <tpfaff@gmx.net>
* libc/stdio/findfp.c (__sfp): Remove unnecessary memset. * libc/stdio/vfprintf.c (__sbprintf): Ditto. Add calls to __lock_init_recursive and __lock_close_recursive instead.
Diffstat (limited to 'newlib')
-rw-r--r--newlib/ChangeLog7
-rw-r--r--newlib/libc/stdio/findfp.c3
-rw-r--r--newlib/libc/stdio/vfprintf.c6
3 files changed, 12 insertions, 4 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog
index 4d84d50..38a26e0 100644
--- a/newlib/ChangeLog
+++ b/newlib/ChangeLog
@@ -1,3 +1,10 @@
+2004-01-16 Thomas Pfaff <tpfaff@gmx.net>
+
+ * libc/stdio/findfp.c (__sfp): Remove unnecessary memset.
+ * libc/stdio/vfprintf.c (__sbprintf): Ditto.
+ Add calls to __lock_init_recursive and __lock_close_recursive
+ instead.
+
2004-01-15 Thomas Pfaff <tpfaff@gmx.net>
* libc/stdio/fclose.c: Include sys/lock.h.
diff --git a/newlib/libc/stdio/findfp.c b/newlib/libc/stdio/findfp.c
index efbb625..aff231e 100644
--- a/newlib/libc/stdio/findfp.c
+++ b/newlib/libc/stdio/findfp.c
@@ -114,9 +114,6 @@ found:
fp->_ub._size = 0;
fp->_lb._base = NULL; /* no line buffer */
fp->_lb._size = 0;
-#ifndef __SINGLE_THREAD__
- memset (&fp->_lock, 0, sizeof(fp->_lock));
-#endif
return fp;
}
diff --git a/newlib/libc/stdio/vfprintf.c b/newlib/libc/stdio/vfprintf.c
index c13a7f7..5fe4431 100644
--- a/newlib/libc/stdio/vfprintf.c
+++ b/newlib/libc/stdio/vfprintf.c
@@ -253,7 +253,7 @@ __sbprintf(fp, fmt, ap)
fake._bf._size = fake._w = sizeof(buf);
fake._lbfsize = 0; /* not actually used, but Just In Case */
#ifndef __SINGLE_THREAD__
- memset (&fake._lock, 0, sizeof(fake._lock));
+ __lock_init_recursive (*(_LOCK_RECURSIVE_T *)&fake._lock);
#endif
/* do the work, then copy any error status */
@@ -262,6 +262,10 @@ __sbprintf(fp, fmt, ap)
ret = EOF;
if (fake._flags & __SERR)
fp->_flags |= __SERR;
+
+#ifndef __SINGLE_THREAD__
+ __lock_close_recursive (*(_LOCK_RECURSIVE_T *)&fake._lock);
+#endif
return (ret);
}