]> git.ipfire.org Git - thirdparty/util-linux.git/commit
libuuid: avoid double open and leaking fd (reworked)
authorPetr Uzel <petr.uzel@suse.cz>
Sun, 6 May 2012 19:55:53 +0000 (21:55 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 10 May 2012 09:43:49 +0000 (11:43 +0200)
commitc544aa2c25095e6a4d4fca761eb15c46435086fc
treec188e1c320037328b009cf9cb6fa252fdeb1a2ad
parentfbf9034e482cbbc9c6acade9a794def0bf26197b
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>
fdisk/fdiskdoslabel.c
include/randutils.h
lib/randutils.c
libuuid/src/gen_uuid.c
libuuid/src/uuidd.h
misc-utils/uuidd.c