From 7b22bec252a155514d811a8e2acc21562ac02bd4 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 5 Mar 2012 20:28:09 +0100 Subject: [PATCH] Don't leak a file descriptor in commonChildInit() --- src/libstore/build.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libstore/build.cc b/src/libstore/build.cc index 4c464d17c..5bdd49bac 100644 --- a/src/libstore/build.cc +++ b/src/libstore/build.cc @@ -367,6 +367,7 @@ void commonChildInit(Pipe & logPipe) throw SysError(format("cannot open `%1%'") % pathNullDevice); if (dup2(fdDevNull, STDIN_FILENO) == -1) throw SysError("cannot dup null device into stdin"); + close(fdDevNull); }