Do not fail lvm_init() if init_logging() generates an errno.
PATCH 1/2 Do not fail lvm_init() if init_logging() generates an errno.
Revert to original behavior of lvm commands if init_logging() generated an errno. Fixes rhbz 592967.
Signed-off-by Dave Wysochanski <[email protected]>
--- lib/commands/toolcontext.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
lib/commands/toolcontext.c +1 -0
@@ -195,6 +195,7 @@ static void _init_logging(struct cmd_context *cmd)dm_log_with_errno_init (print_log);#endif reset_log_duplicated (); +reset_lvm_errno (1 ); }static int _process_config (struct cmd_context *cmd)
Signature · 1 line
1.6.0.6
PATCH 2/2 Revert _init_rand() to reset errno - restores original init behavior.
Signed-off-by Dave Wysochanski <[email protected]>
--- lib/commands/toolcontext.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
lib/commands/toolcontext.c +4 -1
@@ -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)
Signature · 1 line
1.6.0.6