mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
bache: fix error return value
Return 0 as failure (as checked for). Also add INTERNAL_ERROR if 'DI' would be -1.
This commit is contained in:
parent
6b168afcad
commit
6c769eb460
@ -1514,7 +1514,11 @@ void bcache_clear_fd(int di)
|
|||||||
int bcache_change_fd(int di, int fd)
|
int bcache_change_fd(int di, int fd)
|
||||||
{
|
{
|
||||||
if (di >= _fd_table_size)
|
if (di >= _fd_table_size)
|
||||||
return -1;
|
return 0;
|
||||||
|
if (di < 0) {
|
||||||
|
log_error(INTERNAL_ERROR "Cannot change not openned DI with FD:%d", fd);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
_fd_table[di] = fd;
|
_fd_table[di] = fd;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user