From 224457fb0fefdeed88a873e55be095ac9a655f78 Mon Sep 17 00:00:00 2001 From: Dave Wysochanski Date: Tue, 1 Jun 2010 21:47:57 +0000 Subject: [PATCH] Revert _init_rand() to reset errno - restores original init behavior. --- WHATS_NEW | 1 + lib/commands/toolcontext.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/WHATS_NEW b/WHATS_NEW index 556d6c0e2..7f760ee4d 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.67 - =============================== + Do not fail lvm_init() if init_logging() or _init_rand() generates an errno. Don't merge unchanged persistent cache file before dumping if tool scanned. Fix incorrect memory pool deallocation while using vg_read for files. Add --type parameter description to the lvcreate man page. diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c index 33e682b0d..7c5e37943 100644 --- a/lib/commands/toolcontext.c +++ b/lib/commands/toolcontext.c @@ -1084,10 +1084,13 @@ static int _init_backup(struct cmd_context *cmd) static void _init_rand(struct cmd_context *cmd) { - if (read_urandom(&cmd->rand_seed, sizeof(cmd->rand_seed))) + if (read_urandom(&cmd->rand_seed, sizeof(cmd->rand_seed))) { + reset_lvm_errno(1); return; + } cmd->rand_seed = (unsigned) time(NULL) + (unsigned) getpid(); + reset_lvm_errno(1); } static void _init_globals(struct cmd_context *cmd) -- 2.43.5