mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
VFS: invalidate file descriptors after close.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
7d80e8a175
commit
7548679271
@ -682,8 +682,12 @@ vfs_s_close (void *fh)
|
|||||||
}
|
}
|
||||||
vfs_s_invalidate (me, super);
|
vfs_s_invalidate (me, super);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (file->handle != -1)
|
if (file->handle != -1)
|
||||||
|
{
|
||||||
close (file->handle);
|
close (file->handle);
|
||||||
|
file->handle = -1;
|
||||||
|
}
|
||||||
|
|
||||||
vfs_s_free_inode (me, file->ino);
|
vfs_s_free_inode (me, file->ino);
|
||||||
vfs_s_free_fh (sub, fh);
|
vfs_s_free_fh (sub, fh);
|
||||||
|
@ -213,8 +213,10 @@ cpio_free_archive (struct vfs_class *me, struct vfs_s_super *super)
|
|||||||
(void) me;
|
(void) me;
|
||||||
|
|
||||||
if (arch->fd != -1)
|
if (arch->fd != -1)
|
||||||
|
{
|
||||||
mc_close (arch->fd);
|
mc_close (arch->fd);
|
||||||
arch->fd = -1;
|
arch->fd = -1;
|
||||||
|
}
|
||||||
g_slist_free_full (arch->deferred, g_free);
|
g_slist_free_full (arch->deferred, g_free);
|
||||||
arch->deferred = NULL;
|
arch->deferred = NULL;
|
||||||
}
|
}
|
||||||
|
@ -978,6 +978,7 @@ extfs_close (void *fh)
|
|||||||
int errno_code = 0;
|
int errno_code = 0;
|
||||||
|
|
||||||
close (file->handle);
|
close (file->handle);
|
||||||
|
file->handle = -1;
|
||||||
|
|
||||||
/* Commit the file if it has changed */
|
/* Commit the file if it has changed */
|
||||||
if (file->changed)
|
if (file->changed)
|
||||||
|
@ -327,7 +327,10 @@ tar_free_archive (struct vfs_class *me, struct vfs_s_super *archive)
|
|||||||
(void) me;
|
(void) me;
|
||||||
|
|
||||||
if (arch->fd != -1)
|
if (arch->fd != -1)
|
||||||
|
{
|
||||||
mc_close (arch->fd);
|
mc_close (arch->fd);
|
||||||
|
arch->fd = -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------------------------------- */
|
||||||
|
Loading…
Reference in New Issue
Block a user