Tidy up sys_umask a little bit

Consistently use saved fdp pointer as it cannot change. If it could change the
code would be already incorrect.

No functional changes.
This commit is contained in:
Mateusz Guzik 2015-05-18 13:43:33 +00:00
parent a6ffc42f7a
commit c3293b83c4

View File

@ -4158,13 +4158,13 @@ sys_umask(td, uap)
int newmask;
} */ *uap;
{
register struct filedesc *fdp;
struct filedesc *fdp;
FILEDESC_XLOCK(td->td_proc->p_fd);
fdp = td->td_proc->p_fd;
FILEDESC_XLOCK(fdp);
td->td_retval[0] = fdp->fd_cmask;
fdp->fd_cmask = uap->newmask & ALLPERMS;
FILEDESC_XUNLOCK(td->td_proc->p_fd);
FILEDESC_XUNLOCK(fdp);
return (0);
}