Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1071)

Unified Diff: newlib/libc/stdio/findfp.c

Issue 145953007: Revert "Fix race condition in concurrent printf and fopen." (Closed) Base URL: http://git.chromium.org/native_client/nacl-newlib.git@master
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: newlib/libc/stdio/findfp.c
diff --git a/newlib/libc/stdio/findfp.c b/newlib/libc/stdio/findfp.c
index 4a465eb4f4cf4d37c3b606e0fd08c0cf5225eeed..42211afa42aa2029a04cbad0e5e9362eb438dde4 100644
--- a/newlib/libc/stdio/findfp.c
+++ b/newlib/libc/stdio/findfp.c
@@ -115,7 +115,6 @@ _DEFUN(__sfp, (d),
FILE *fp;
int n;
struct _glue *g;
- int found_fp = 0;
CHECK_INIT(_GLOBAL_REENT, NULL);
@@ -124,13 +123,8 @@ _DEFUN(__sfp, (d),
for (g = &_GLOBAL_REENT->__sglue;; g = g->_next)
{
for (fp = g->_iobs, n = g->_niobs; --n >= 0; fp++)
- {
- _flockfile(fp);
- found_fp = (fp->_flags == 0);
- _funlockfile(fp);
- if (found_fp)
- goto found;
- }
+ if (fp->_flags == 0)
+ goto found;
if (g->_next == NULL &&
(g->_next = __sfmoreglue (d, NDYNAMIC)) == NULL)
break;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698