master - do_flock: mark descriptor as closed
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=b4fc397de6a456efb8b8cce1e7d0048d4573f7cc Commit: b4fc397de6a456efb8b8cce1e7d0048d4573f7cc Parent: 782a356e7cce8d0d32850677cdb5a9b28996471e Author: Zdenek Kabelac <[email protected]> AuthorDate: Fri Nov 22 13:16:12 2013 +0100 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Fri Nov 22 21:00:55 2013 +0100
do_flock: mark descriptor as closed
Keep the structure content valid in error path
and mark descriptor as closed (-1).
--- lib/locking/file_locking.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
lib/locking/file_locking.c +1 -0
@@ -163,6 +163,7 @@ static int _do_flock(const char *file, int *fd, int operation, uint32_t nonblocklog_sys_error ("flock" , file);if (close (*fd))log_sys_error ("close" , file); + *fd =-1 ;return 0 ; }