mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
block: move fcntl_setfl()
It is only used by block/file-posix.c, move it there. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
4d14cb0cd7
commit
ad24b679d2
3 changed files with 15 additions and 17 deletions
|
@ -1022,6 +1022,21 @@ static int raw_handle_perm_lock(BlockDriverState *bs,
|
|||
return ret;
|
||||
}
|
||||
|
||||
/* Sets a specific flag */
|
||||
static int fcntl_setfl(int fd, int flag)
|
||||
{
|
||||
int flags;
|
||||
|
||||
flags = fcntl(fd, F_GETFL);
|
||||
if (flags == -1) {
|
||||
return -errno;
|
||||
}
|
||||
if (fcntl(fd, F_SETFL, flags | flag) == -1) {
|
||||
return -errno;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int raw_reconfigure_getfd(BlockDriverState *bs, int flags,
|
||||
int *open_flags, uint64_t perm, bool force_dup,
|
||||
Error **errp)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue