diff options
| author | Konstantin Belousov <kib@FreeBSD.org> | 2017-07-17 14:09:34 +0000 | 
|---|---|---|
| committer | Konstantin Belousov <kib@FreeBSD.org> | 2017-07-17 14:09:34 +0000 | 
| commit | 1aad44dbd7ec77df8137d3e510d0a200256a02d3 (patch) | |
| tree | c44ef6d528ce250c6d8c2c124a1d91a8523a54a1 /lib/libc/stdio/setvbuf.c | |
| parent | 5d49799eb6c6c0710b12180fb899fd0ea8f69639 (diff) | |
Notes
Diffstat (limited to 'lib/libc/stdio/setvbuf.c')
| -rw-r--r-- | lib/libc/stdio/setvbuf.c | 8 | 
1 files changed, 4 insertions, 4 deletions
| diff --git a/lib/libc/stdio/setvbuf.c b/lib/libc/stdio/setvbuf.c index d39696058616..01db02ea9b64 100644 --- a/lib/libc/stdio/setvbuf.c +++ b/lib/libc/stdio/setvbuf.c @@ -63,7 +63,7 @@ setvbuf(FILE * __restrict fp, char * __restrict buf, int mode, size_t size)  		if ((mode != _IOFBF && mode != _IOLBF) || (int)size < 0)  			return (EOF); -	FLOCKFILE(fp); +	FLOCKFILE_CANCELSAFE(fp);  	/*  	 * Write current buffer, if any.  Discard unread input (including  	 * ungetc data), cancel line buffering, and free old buffer if @@ -115,8 +115,7 @@ nbf:  			fp->_w = 0;  			fp->_bf._base = fp->_p = fp->_nbuf;  			fp->_bf._size = 1; -			FUNLOCKFILE(fp); -			return (ret); +			goto end;  		}  		flags |= __SMBF;  	} @@ -156,6 +155,7 @@ nbf:  	}  	__cleanup = _cleanup; -	FUNLOCKFILE(fp); +end: +	FUNLOCKFILE_CANCELSAFE();  	return (ret);  } | 
