summaryrefslogtreecommitdiff
path: root/lib/libc/stdio/setvbuf.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/stdio/setvbuf.c')
-rw-r--r--lib/libc/stdio/setvbuf.c8
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);
}