Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-commits: [Wireshark-commits] rev 42961: /trunk/ /trunk/: file.c /trunk/wiretap/: file_acc

Date: Fri, 01 Jun 2012 08:05:13 GMT
http://anonsvn.wireshark.org/viewvc/viewvc.cgi?view=rev&revision=42961

User: guy
Date: 2012/06/01 01:05 AM

Log:
 Sigh.  There appears to be no way to get Windows to allow us to rename a
 file that we ourselves have open.  In the "safe save" code path for
 capture files, on Windows temporarily close the file descriptors for the
 currently-open capture before doing the rename and then, if the rename
 failed, reopen them, leaving the rest of the wtap and capture_file
 structures intact.
 
 Rename filed_open() to file_fdopen(), to make its name match what it
 does a bit better (it's an fdopen()-style routine, i.e. do the
 equivalent of an open with an already-open file descriptor rather than a
 pathname, in the file_wrappers.c set of routines).
 
 Remove the file_ routines from the .def file for Wiretap - they should
 only be called by code inside Wiretap.
 
 Closing a descriptor open for input has no reason to fail (closing a
 descriptor open for *writing* could fail if the file is on a server and
 dirty pages are pushed asynchronously to the server and synchronously on
 a close), so just have file_close() return void.

Directory: /trunk/
  Changes    Path          Action
  +18 -9     file.c        Modified

Directory: /trunk/wiretap/
  Changes    Path               Action
  +1 -1      file_access.c      Modified
  +28 -4     file_wrappers.c    Modified
  +4 -2      file_wrappers.h    Modified
  +129 -0    wtap.c             Modified
  +2 -14     wtap.def           Modified
  +7 -0      wtap.h             Modified