unwind v_writecount in fhopen() if we are unable to allocate the

descriptor.

MFC after:	3 days
This commit is contained in:
Matthew Dillon 2001-10-24 18:32:17 +00:00
parent 553b79aa63
commit a06fe5111e
2 changed files with 8 additions and 2 deletions

View File

@ -3622,8 +3622,11 @@ fhopen(td, uap)
* end of vn_open code
*/
if ((error = falloc(td, &nfp, &indx)) != 0)
if ((error = falloc(td, &nfp, &indx)) != 0) {
if (fmode & FWRITE)
vp->v_writecount--;
goto bad;
}
fp = nfp;
/*

View File

@ -3622,8 +3622,11 @@ fhopen(td, uap)
* end of vn_open code
*/
if ((error = falloc(td, &nfp, &indx)) != 0)
if ((error = falloc(td, &nfp, &indx)) != 0) {
if (fmode & FWRITE)
vp->v_writecount--;
goto bad;
}
fp = nfp;
/*