a question about socket-syscall, thinks

From: Jon (comepu_at_gmail.com)
Date: 11/25/05

  • Next message: Robert Watson: "Re: a question about socket-syscall, thinks"
    To: <freebsd-net@freebsd.org>
    Date: Fri, 25 Nov 2005 16:35:39 +0800
    
    
    

     NET_LOCK_GIANT();
     error = socreate(uap->domain, &so, uap->type, uap->protocol,
         td->td_ucred, td);
     NET_UNLOCK_GIANT();
     if (error) {
      fdclose(fdp, fp, fd, td);
     } else {
      FILEDESC_LOCK_FAST(fdp);
      fp->f_data = so; /* already has ref count */
      fp->f_flag = FREAD|FWRITE;
      fp->f_ops = &socketops;
      fp->f_type = DTYPE_SOCKET;
      FILEDESC_UNLOCK_FAST(fdp);
      td->td_retval[0] = fd;
     }
     fdrop(fp, td);
     return (error);

    I found these lines in "kern/uipc_syscalls.c(166-182, version:5.4)". I had a question! Why drop "fp" if socreate function return success? Can you tell me? Thank you very much!

    Joe


    
    

    _______________________________________________
    freebsd-net@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-net
    To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"


  • Next message: Robert Watson: "Re: a question about socket-syscall, thinks"