From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:53832) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ruljj-0001Ug-TL for qemu-devel@nongnu.org; Tue, 07 Feb 2012 09:09:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ruljf-0005eO-20 for qemu-devel@nongnu.org; Tue, 07 Feb 2012 09:09:35 -0500 Received: from oxygen.pond.sub.org ([78.46.104.156]:39172) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rulje-0005dC-RG for qemu-devel@nongnu.org; Tue, 07 Feb 2012 09:09:30 -0500 From: Markus Armbruster Date: Tue, 7 Feb 2012 15:09:09 +0100 Message-Id: <1328623766-12287-3-git-send-email-armbru@redhat.com> In-Reply-To: <1328623766-12287-1-git-send-email-armbru@redhat.com> References: <1328623766-12287-1-git-send-email-armbru@redhat.com> Subject: [Qemu-devel] [PATCH 02/19] qemu-char: Use qemu_open() to avoid leaking fds to children List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, aliguori@us.ibm.com 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 --- 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