mirror of
https://github.com/mii443/qemu.git
synced 2025-08-22 15:15:46 +00:00
Refactoring: refactor TFR() macro to RETRY_ON_EINTR()
Rename macro name to more transparent one and refactor it to expression. Signed-off-by: Nikita Ivanov <nivanov@cloudlinux.com> Message-Id: <20221023090422.242617-2-nivanov@cloudlinux.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Christian Schoenebeck <qemu_oss@crudebyte.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
This commit is contained in:
committed by
Thomas Huth
parent
d88ce91299
commit
8b6aa69365
@ -198,7 +198,7 @@ int qmp_chardev_open_file_source(char *src, int flags, Error **errp)
|
||||
{
|
||||
int fd = -1;
|
||||
|
||||
TFR(fd = qemu_open_old(src, flags, 0666));
|
||||
fd = RETRY_ON_EINTR(qemu_open_old(src, flags, 0666));
|
||||
if (fd == -1) {
|
||||
error_setg_file_open(errp, errno, src);
|
||||
}
|
||||
|
@ -131,8 +131,8 @@ static void qemu_chr_open_pipe(Chardev *chr,
|
||||
|
||||
filename_in = g_strdup_printf("%s.in", filename);
|
||||
filename_out = g_strdup_printf("%s.out", filename);
|
||||
TFR(fd_in = qemu_open_old(filename_in, O_RDWR | O_BINARY));
|
||||
TFR(fd_out = qemu_open_old(filename_out, O_RDWR | O_BINARY));
|
||||
fd_in = RETRY_ON_EINTR(qemu_open_old(filename_in, O_RDWR | O_BINARY));
|
||||
fd_out = RETRY_ON_EINTR(qemu_open_old(filename_out, O_RDWR | O_BINARY));
|
||||
g_free(filename_in);
|
||||
g_free(filename_out);
|
||||
if (fd_in < 0 || fd_out < 0) {
|
||||
@ -142,7 +142,9 @@ static void qemu_chr_open_pipe(Chardev *chr,
|
||||
if (fd_out >= 0) {
|
||||
close(fd_out);
|
||||
}
|
||||
TFR(fd_in = fd_out = qemu_open_old(filename, O_RDWR | O_BINARY));
|
||||
fd_in = fd_out = RETRY_ON_EINTR(
|
||||
qemu_open_old(filename, O_RDWR | O_BINARY)
|
||||
);
|
||||
if (fd_in < 0) {
|
||||
error_setg_file_open(errp, errno, filename);
|
||||
return;
|
||||
|
Reference in New Issue
Block a user