1 $NetBSD: patch-ab,v 1.3 2011/07/13 21:21:52 adam Exp $
3 --- random/rndunix.c.orig 2011-02-04 19:16:03.000000000 +0000
11 /* OS-specific includes */
13 @@ -737,6 +738,15 @@ start_gatherer( int pipefd )
14 if( i != n1 && i != n2 && i != pipefd )
18 + /* Reopen standard files (only if needed) so that NetBSD does not
19 + complain about executing set[ug]id programs with descriptors 0
20 + and/or 1 closed. At this point, 2 is still open. */
21 + if ((i = open("/dev/null", O_RDONLY)) != STDIN_FILENO)
23 + if ((i = open("/dev/null", O_WRONLY)) != STDOUT_FILENO)
29 @@ -764,6 +774,10 @@ start_gatherer( int pipefd )
32 fclose(stderr); /* Arrghh!! It's Stuart code!! */
34 + int i = open("/dev/null", O_WRONLY);
35 + assert(i == STDERR_FILENO);