From bcde12940007e836f7b831f1cdfda8dc2bda0c58 Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Fri, 24 Apr 2009 22:52:52 +0000 Subject: 2009-04-24 Jeff johnston * libc/stdio/fgetc.c: Make sure sfp lock is acquired before the file lock and released before the file lock to avoid a deadlock scenario. * libc/stdio/fgets.c: Ditto. * libc/stdio/fgetwc.c: Ditto. * libc/stdio/fgetws.c: Ditto. * libc/stdio/fread.c: Ditto. * libc/stdio/fseek.c: Ditto. * libc/stdio/getc.c: Ditto. * libc/stdio/getdelim.c: Ditto. * libc/stdio/gets.c: Ditto. --- newlib/libc/stdio/getdelim.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'newlib/libc/stdio/getdelim.c') diff --git a/newlib/libc/stdio/getdelim.c b/newlib/libc/stdio/getdelim.c index 23fc50218..41460ab42 100644 --- a/newlib/libc/stdio/getdelim.c +++ b/newlib/libc/stdio/getdelim.c @@ -81,6 +81,7 @@ _DEFUN(__getdelim, (bufptr, n, delim, fp), CHECK_INIT (_REENT, fp); + __sfp_lock_acquire (); _flockfile (fp); numbytes = *n; @@ -130,6 +131,7 @@ _DEFUN(__getdelim, (bufptr, n, delim, fp), } _funlockfile (fp); + __sfp_lock_release (); /* if no input data, return failure */ if (ptr == buf) -- cgit v1.2.3