summaryrefslogtreecommitdiff
path: root/www/mozilla-stable/patches/patch-af
blob: a6ec2abf4e1ec23e88c64add6947662c3090acd0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
$NetBSD: patch-af,v 1.1 2003/11/27 23:36:42 taya Exp $

diff -ru ../Orig/mozilla/security/nss/lib/freebl/unix_rand.c ./security/nss/lib/freebl/unix_rand.c
--- ../Orig/mozilla/security/nss/lib/freebl/unix_rand.c	2002-05-18 09:52:09.000000000 +0900
+++ ./security/nss/lib/freebl/unix_rand.c	2003-03-14 16:58:47.000000000 +0900
@@ -32,6 +32,7 @@
  */
 
 #include <stdio.h>
+#include <fcntl.h>
 #include <string.h>
 #include <signal.h>
 #include <unistd.h>
@@ -691,7 +692,11 @@
 	/* dup write-side of pipe to stderr and stdout */
 	if (p[1] != 1) dup2(p[1], 1);
 	if (p[1] != 2) dup2(p[1], 2);
-	close(0);
+	fd = open("/dev/null", O_RDONLY);
+	if (fd != 0) {
+	    dup2(fd, 0);
+	    close(fd);
+	}
 	for (fd = getdtablesize(); --fd > 2; close(fd))
 	    ;