diff options
author | Petr Uzel | 2012-05-06 21:55:53 +0200 |
---|---|---|
committer | Karel Zak | 2012-05-10 11:43:49 +0200 |
commit | c544aa2c25095e6a4d4fca761eb15c46435086fc (patch) | |
tree | c188e1c320037328b009cf9cb6fa252fdeb1a2ad /libuuid/src/uuidd.h | |
parent | lslocks: fix bracket indentation (diff) | |
download | kernel-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 'libuuid/src/uuidd.h')
-rw-r--r-- | libuuid/src/uuidd.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libuuid/src/uuidd.h b/libuuid/src/uuidd.h index 2e19522df..27b79c216 100644 --- a/libuuid/src/uuidd.h +++ b/libuuid/src/uuidd.h @@ -49,6 +49,6 @@ #define UUIDD_MAX_OP UUIDD_OP_BULK_RANDOM_UUID extern int __uuid_generate_time(uuid_t out, int *num); -extern void __uuid_generate_random(uuid_t out, int *num, int fd); +extern void __uuid_generate_random(uuid_t out, int *num); #endif /* _UUID_UUID_H */ |