Re: [PATCH] please review. file descriptor passing for libc_r.

From: Alfred Perlstein (bright_at_mu.org)
Date: 11/30/03

  • Next message: Joe Marcus Clarke: "Re: Western Digital WD360GD SATA disk on -CURRENT"
    Date: Sat, 29 Nov 2003 21:51:53 -0800
    To: Daniel Eischen <eischen@vigrid.com>
    
    

    Seems like a good diff.

    * Daniel Eischen <eischen@vigrid.com> [031129 21:41] wrote:
    >
    > You should just call close() if the fd has not been initialized.
    >
    > Index: uthread_close.c
    > ===================================================================
    > RCS file: /opt/FreeBSD/cvs/src/lib/libc_r/uthread/uthread_close.c,v
    > retrieving revision 1.16
    > diff -u -r1.16 uthread_close.c
    > --- uthread_close.c 9 Jun 2003 16:45:37 -0000 1.16
    > +++ uthread_close.c 30 Nov 2003 09:05:52 -0000
    > @@ -50,8 +50,7 @@
    > struct fd_table_entry *entry;
    >
    > if ((fd < 0) || (fd >= _thread_dtablesize) ||
    > - (fd == _thread_kern_pipe[0]) || (fd == _thread_kern_pipe[1]) ||
    > - (_thread_fd_table[fd] == NULL)) {
    > + (fd == _thread_kern_pipe[0]) || (fd == _thread_kern_pipe[1])) {
    > /*
    > * Don't allow silly programs to close the kernel pipe
    > * and non-active descriptors.
    > @@ -59,6 +58,8 @@
    > errno = EBADF;
    > ret = -1;
    > }
    > + else if (_thread_fd_table[fd] == NULL)
    > + ret = __sys_close(fd);
    > /*
    > * Lock the file descriptor while the file is closed and get
    > * the file descriptor status:
    >
    > --
    > Dan Eischen

    -- 
    - Alfred Perlstein
    - Research Engineering Development Inc.
    - email: bright@mu.org cell: 408-480-4684
    _______________________________________________
    freebsd-current@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-current
    To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
    

  • Next message: Joe Marcus Clarke: "Re: Western Digital WD360GD SATA disk on -CURRENT"

    Relevant Pages

    • fix for libpthread
      ... retrieving revision 1.21 ... diff -u -r1.21 thr_spinlock.c ... Alfred Perlstein ... Research Engineering Development Inc. ...
      (freebsd-current)
    • aio patch for review.
      ... retrieving revision 1.176 ... diff -u -r1.176 vfs_aio.c ... Alfred Perlstein ... Research Engineering Development Inc. ...
      (freebsd-net)
    • [Fwd: RFC.. defining __rangeof() in cdefs.h]
      ... retrieving revision 1.83 ... diff -u -r1.83 cdefs.h ... * Compiler-dependent macros to declare that functions take printf-like ... To unsubscribe, ...
      (freebsd-current)
    • Re: buildworld error (CVS july 4)
      ... retrieving revision 1.23.2.7 ... * compact the IP header into a structure which contains just the info. ... diff -u -r1.25.2.7 ip_fil.c ... I do not "unsubscribe" from email "services" to which I have not explicitly ...
      (freebsd-stable)
    • [PATCH 2/9] convert crypto to virt_to_pageoff()
      ... convert cryptoapi to virt_to_pageoff. ... retrieving revision 1.3 ... diff -u -r1.13 tcrypt.c ... To unsubscribe from this list: send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)