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


_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to