[BACK]Return to kern_descrip.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / kern

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/sys/kern/kern_descrip.c between version 1.143 and 1.144

version 1.143, 2006/05/14 21:15:11 version 1.144, 2006/07/23 22:06:11
Line 951  restart:
Line 951  restart:
  * a file descriptor for the process that refers to it.   * a file descriptor for the process that refers to it.
  */   */
 int  int
 falloc(struct proc *p, struct file **resultfp, int *resultfd)  falloc(struct lwp *l, struct file **resultfp, int *resultfd)
 {  {
         struct file     *fp, *fq;          struct file     *fp, *fq;
           struct proc     *p;
         int             error, i;          int             error, i;
   
           p = l->l_proc;
   
  restart:   restart:
         if ((error = fdalloc(p, 0, &i)) != 0) {          if ((error = fdalloc(p, 0, &i)) != 0) {
                 if (error == ENOSPC) {                  if (error == ENOSPC) {
Line 995  falloc(struct proc *p, struct file **res
Line 998  falloc(struct proc *p, struct file **res
         p->p_fd->fd_ofiles[i] = fp;          p->p_fd->fd_ofiles[i] = fp;
         simple_lock_init(&fp->f_slock);          simple_lock_init(&fp->f_slock);
         fp->f_count = 1;          fp->f_count = 1;
         fp->f_cred = p->p_cred;          fp->f_cred = l->l_cred;
         kauth_cred_hold(fp->f_cred);          kauth_cred_hold(fp->f_cred);
         if (resultfp) {          if (resultfp) {
                 fp->f_usecount = 1;                  fp->f_usecount = 1;
Line 1776  fdcheckstd(l)
Line 1779  fdcheckstd(l)
                 snprintf(which, sizeof(which), ",%d", i);                  snprintf(which, sizeof(which), ",%d", i);
                 strlcat(closed, which, sizeof(closed));                  strlcat(closed, which, sizeof(closed));
                 if (devnullfp == NULL) {                  if (devnullfp == NULL) {
                         if ((error = falloc(p, &fp, &fd)) != 0)                          if ((error = falloc(l, &fp, &fd)) != 0)
                                 return (error);                                  return (error);
                         NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, "/dev/null",                          NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, "/dev/null",
                             l);                              l);

Legend:
Removed from v.1.143  
changed lines
  Added in v.1.144

CVSweb <webmaster@jp.NetBSD.org>