mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
Replace qemu_pipe() with g_unix_open_pipe()
GLib g_unix_open_pipe() is essentially like qemu_pipe(), available since 2.30. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
ad24b679d2
commit
a7241974ce
4 changed files with 4 additions and 29 deletions
|
@ -274,28 +274,6 @@ void qemu_set_cloexec(int fd)
|
|||
assert(f != -1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Creates a pipe with FD_CLOEXEC set on both file descriptors
|
||||
*/
|
||||
int qemu_pipe(int pipefd[2])
|
||||
{
|
||||
int ret;
|
||||
|
||||
#ifdef CONFIG_PIPE2
|
||||
ret = pipe2(pipefd, O_CLOEXEC);
|
||||
if (ret != -1 || errno != ENOSYS) {
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
ret = pipe(pipefd);
|
||||
if (ret == 0) {
|
||||
qemu_set_cloexec(pipefd[0]);
|
||||
qemu_set_cloexec(pipefd[1]);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
char *
|
||||
qemu_get_local_state_dir(void)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue