1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-11 20:58:50 +03:00

Don't leak a file descriptor in _lock_file when flock fails.

* lib/locking/file_locking.c (_lock_file): Close fd upon flock failure.
This commit is contained in:
Jim Meyering 2007-07-20 12:12:52 +00:00
parent 35b13fdb5e
commit 57015b12e2
2 changed files with 10 additions and 9 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.28 - Version 2.02.28 -
================================ ================================
Don't leak a file descriptor in _lock_file(), when flock fails.
Add SUN's LDOM virtual block device to filters Add SUN's LDOM virtual block device to filters
Split metadata-external.h out from metadata.h for the tools to use. Split metadata-external.h out from metadata.h for the tools to use.
@ -1026,4 +1027,3 @@ Display output. Some metadata information cannot yet be displayed.
Recovery tools to salvage "lost" metadata directly from the disks: Recovery tools to salvage "lost" metadata directly from the disks:
but we hope the new format will mean such tools are hardly ever needed! but we hope the new format will mean such tools are hardly ever needed!

View File

@ -185,6 +185,7 @@ static int _lock_file(const char *file, int flags)
if (r) { if (r) {
errno = old_errno; errno = old_errno;
log_sys_error("flock", ll->res); log_sys_error("flock", ll->res);
close(ll->lf);
goto err; goto err;
} }