From a8f62a960bc7ad4787e2b9801fb444ee39860f90 Mon Sep 17 00:00:00 2001 From: Vincent Penquerc'h Date: Sat, 15 Feb 2014 07:04:51 -0500 Subject: [PATCH] Do not close fd 2 if it's the one we need This should not happen based if stderr was not already closed, but it's better not to make assumptions. --- dispvm/qubes-restore.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dispvm/qubes-restore.c b/dispvm/qubes-restore.c index 8b6af13a..0db9140c 100644 --- a/dispvm/qubes-restore.c +++ b/dispvm/qubes-restore.c @@ -465,6 +465,8 @@ void redirect_stderr(void) exit(1); } dup2(fd, 2); + if (fd != 2) + close(fd); }