aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/file_access.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2012-06-01 08:05:12 +0000
committerGuy Harris <guy@alum.mit.edu>2012-06-01 08:05:12 +0000
commit129c881fcf7c8707f379a09d2ed2cdfcc178b807 (patch)
treec3e2e1a9b39235d5b89594d3947e849d9152c09a /wiretap/file_access.c
parent86c69b01e7965f37eecbe6195e797a52ab81e23e (diff)
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. svn path=/trunk/; revision=42961
Diffstat (limited to 'wiretap/file_access.c')
-rw-r--r--wiretap/file_access.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/wiretap/file_access.c b/wiretap/file_access.c
index b6525f07e8..6e88b69d96 100644
--- a/wiretap/file_access.c
+++ b/wiretap/file_access.c
@@ -317,7 +317,7 @@ wtap* wtap_open_offline(const char *filename, int *err, char **err_info,
return NULL;
}
#endif
- if (!(wth->fh = filed_open(fd))) {
+ if (!(wth->fh = file_fdopen(fd))) {
*err = errno;
ws_close(fd);
g_free(wth);