~mdw
/
become
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
e6677da
)
Fix test for `/dev/random' so that it doesn't close `stdin' if it fails!
author
mdw
<mdw>
Wed, 20 Aug 1997 16:19:57 +0000
(16:19 +0000)
committer
mdw
<mdw>
Wed, 20 Aug 1997 16:19:57 +0000
(16:19 +0000)
src/noise.c
patch
|
blob
|
blame
|
history
diff --git
a/src/noise.c
b/src/noise.c
index
a469b13
..
88b4de5
100644
(file)
--- a/
src/noise.c
+++ b/
src/noise.c
@@
-1,6
+1,6
@@
/* -*-c-*-
*
/* -*-c-*-
*
- * $Id: noise.c,v 1.
1 1997/08/07 09:45:26
mdw Exp $
+ * $Id: noise.c,v 1.
2 1997/08/20 16:19:57
mdw Exp $
*
* Collection of environmental noise
*
*
* Collection of environmental noise
*
@@
-29,6
+29,9
@@
/*----- Revision history --------------------------------------------------*
*
* $Log: noise.c,v $
/*----- Revision history --------------------------------------------------*
*
* $Log: noise.c,v $
+ * Revision 1.2 1997/08/20 16:19:57 mdw
+ * Fix test for `/dev/random' so that it doesn't close `stdin' if it fails!
+ *
* Revision 1.1 1997/08/07 09:45:26 mdw
* New source file added to acquire environmental noise and add it to the
* randomness pool (see `rand.c').
* Revision 1.1 1997/08/07 09:45:26 mdw
* New source file added to acquire environmental noise and add it to the
* randomness pool (see `rand.c').
@@
-196,7
+199,7
@@
void noise_acquire(void)
unsigned char buff[64];
ssize_t sz;
unsigned char buff[64];
ssize_t sz;
- if ((fd = open("/dev/random", O_RDONLY)
>= 0)
&&
+ if ((fd = open("/dev/random", O_RDONLY)
) >= 0
&&
(f = fcntl(fd, F_GETFL, 0)) >= 0 &&
fcntl(fd, F_SETFL, f | O_NONBLOCK) >= 0 &&
(sz = read(fd, buff, sizeof(buff))) > 0) {
(f = fcntl(fd, F_GETFL, 0)) >= 0 &&
fcntl(fd, F_SETFL, f | O_NONBLOCK) >= 0 &&
(sz = read(fd, buff, sizeof(buff))) > 0) {