Ethereal-cvs: [Ethereal-cvs] cvs commit: ethereal ringbuffer.c

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: guy@xxxxxxxxxxxx (Guy Harris)
Date: Wed, 2 Jun 2004 13:49:41 -0500 (CDT)
guy         2004/06/02 13:49:41 CDT

  Modified files:
    .                    ringbuffer.c 
  Log:
  If, when rotating capture files, the attempt to close the current file
  fails, set "rb_data.pdh" to NULL, so we know it's not open (if
  "wtap_dump_close()" fails, the wtap_dumper_t is still closed - and the
  file descriptor for it is probably closed, too, as, if "close()" fails,
  the FD is probably closed; the Single UNIX Specification Version 3 says
  the state of the FD is unspecified, but in practice most OSes probably
  still close it).
  
  If we try to close the current file, first check to make sure it's open,
  i.e. that "rb_data.pdh" is non-null.  (Or perhaps we should avoid trying
  to close it if the open *or* the most recent attempt to rotate the
  capture files failed.)
  
  Note that if "wtap_dump_close()" fails we might not need to close the
  underlying file descriptor (and, even if we do, there's no guarantee
  that attempt won't also fail and leave the FD still open - which is why
  I suspect that a failed "close()" leaves the FD closed on most OSes).
  
  Revision  Changes    Path
  1.10      +14 -9     ethereal/ringbuffer.c