[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 02/19] qemu-char: Use qemu_open() to avoid leaking f
From: |
Markus Armbruster |
Subject: |
[Qemu-devel] [PATCH 02/19] qemu-char: Use qemu_open() to avoid leaking fds to children |
Date: |
Tue, 7 Feb 2012 15:09:09 +0100 |
Fixed silently in commit aad04cd0, but that just got reverted.
Re-apply the fixes, plus one missed instance: parport on Linux.
Signed-off-by: Markus Armbruster <address@hidden>
---
qemu-char.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/qemu-char.c b/qemu-char.c
index 1e882cf..368df2e 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -665,7 +665,7 @@ static CharDriverState *qemu_chr_open_pipe(QemuOpts *opts)
close(fd_in);
if (fd_out >= 0)
close(fd_out);
- TFR(fd_in = fd_out = open(filename, O_RDWR | O_BINARY));
+ TFR(fd_in = fd_out = qemu_open(filename, O_RDWR | O_BINARY));
if (fd_in < 0)
return NULL;
}
@@ -1217,7 +1217,7 @@ static CharDriverState *qemu_chr_open_tty(QemuOpts *opts)
CharDriverState *chr;
int fd;
- TFR(fd = open(filename, O_RDWR | O_NONBLOCK));
+ TFR(fd = qemu_open(filename, O_RDWR | O_NONBLOCK));
if (fd < 0) {
return NULL;
}
@@ -1355,7 +1355,7 @@ static CharDriverState *qemu_chr_open_pp(QemuOpts *opts)
ParallelCharDriver *drv;
int fd;
- TFR(fd = open(filename, O_RDWR));
+ TFR(fd = qemu_open(filename, O_RDWR));
if (fd < 0)
return NULL;
@@ -1424,7 +1424,7 @@ static CharDriverState *qemu_chr_open_pp(QemuOpts *opts)
CharDriverState *chr;
int fd;
- fd = open(filename, O_RDWR);
+ fd = qemu_open(filename, O_RDWR);
if (fd < 0)
return NULL;
--
1.7.6.5
- [Qemu-devel] [PATCH 09/19] sockets: Chardev open error reporting, sockets part, (continued)
- [Qemu-devel] [PATCH 09/19] sockets: Chardev open error reporting, sockets part, Markus Armbruster, 2012/02/07
- Re: [Qemu-devel] [PATCH 09/19] sockets: Chardev open error reporting, sockets part, Anthony Liguori, 2012/02/07
- Re: [Qemu-devel] [PATCH 09/19] sockets: Chardev open error reporting, sockets part, Markus Armbruster, 2012/02/09
- Re: [Qemu-devel] [PATCH 09/19] sockets: Chardev open error reporting, sockets part, Markus Armbruster, 2012/02/14
- Re: [Qemu-devel] [PATCH 09/19] sockets: Chardev open error reporting, sockets part, Anthony Liguori, 2012/02/14
- Re: [Qemu-devel] [PATCH 09/19] sockets: Chardev open error reporting, sockets part, Markus Armbruster, 2012/02/15
- Re: [Qemu-devel] [PATCH 09/19] sockets: Chardev open error reporting, sockets part, Anthony Liguori, 2012/02/22
- Re: [Qemu-devel] [PATCH 09/19] sockets: Chardev open error reporting, sockets part, Markus Armbruster, 2012/02/23
[Qemu-devel] [PATCH 16/19] spice-qemu-char: Chardev open error reporting, spicevmc part, Markus Armbruster, 2012/02/07
[Qemu-devel] [PATCH 12/19] qemu-char: Chardev open error reporting, tty part, Markus Armbruster, 2012/02/07
[Qemu-devel] [PATCH 02/19] qemu-char: Use qemu_open() to avoid leaking fds to children,
Markus Armbruster <=
[Qemu-devel] [PATCH 13/19] qemu-char: Chardev open error reporting, parport part, Markus Armbruster, 2012/02/07
[Qemu-devel] [PATCH 08/19] sockets: Clean up inet_listen_opts()'s convoluted bind() loop, Markus Armbruster, 2012/02/07
[Qemu-devel] [PATCH 04/19] qemu-char: qemu_chr_open_fd() can't fail, don't check, Markus Armbruster, 2012/02/07
[Qemu-devel] [PATCH 07/19] sockets: Drop sockets_debug debug code, Markus Armbruster, 2012/02/07
[Qemu-devel] [PATCH 06/19] gdbstub: Error locations for -gdb, Markus Armbruster, 2012/02/07
[Qemu-devel] [PATCH 14/19] console: Eliminate text_consoles[], Markus Armbruster, 2012/02/07