summaryrefslogtreecommitdiffstats
path: root/include/randutils.h
diff options
context:
space:
mode:
authorPetr Uzel2012-05-06 21:55:53 +0200
committerKarel Zak2012-05-10 11:43:49 +0200
commitc544aa2c25095e6a4d4fca761eb15c46435086fc (patch)
treec188e1c320037328b009cf9cb6fa252fdeb1a2ad /include/randutils.h
parentlslocks: fix bracket indentation (diff)
downloadkernel-qcow2-util-linux-c544aa2c25095e6a4d4fca761eb15c46435086fc.tar.gz
kernel-qcow2-util-linux-c544aa2c25095e6a4d4fca761eb15c46435086fc.tar.xz
kernel-qcow2-util-linux-c544aa2c25095e6a4d4fca761eb15c46435086fc.zip
libuuid: avoid double open and leaking fd (reworked)
This reverts commit 6126f7a53c57485a9a29ddd772765695f23c92e6 and fixes the double open and leaking descriptor in a different way, that is by using newly introduced function 'have_random_source()' to check whether good random source is available while deciding which uuid type to generate (random/time). This is better than calling random_get_fd() twice, passing the file descriptor down the stack and reusing it in next call to random_get_fd(). Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
Diffstat (limited to 'include/randutils.h')
-rw-r--r--include/randutils.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/randutils.h b/include/randutils.h
index d5d00f469..dec5e355a 100644
--- a/include/randutils.h
+++ b/include/randutils.h
@@ -7,6 +7,6 @@
#endif
extern int random_get_fd(void);
-extern void random_get_bytes(void *buf, size_t nbytes, int fd);
+extern void random_get_bytes(void *buf, size_t nbytes);
#endif