1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-10-09 23:33:17 +03:00

Store any errno and error messages issued while processing each command.

(Enabled by default while we test it, but in due course we'll only store
the error messages when we need to.)
This commit is contained in:
Alasdair Kergon
2009-07-15 23:57:54 +00:00
parent 7da36611dc
commit 0ed40c04c7
8 changed files with 70 additions and 14 deletions

View File

@@ -190,7 +190,7 @@ static void _init_logging(struct cmd_context *cmd)
/* Tell device-mapper about our logging */
#ifdef DEVMAPPER_SUPPORT
dm_log_init(print_log);
dm_log_with_errno_init(print_log);
#endif
}
@@ -1161,6 +1161,7 @@ struct cmd_context *create_toolcontext(unsigned is_long_lived,
cmd->current_settings = cmd->default_settings;
cmd->config_valid = 1;
reset_lvm_errno(1); /* FIXME Move to top when cmd returned on error */
return cmd;
error:
@@ -1288,6 +1289,8 @@ int refresh_toolcontext(struct cmd_context *cmd)
persistent_filter_dump(cmd->filter);
cmd->config_valid = 1;
reset_lvm_errno(1);
return 1;
}
@@ -1317,4 +1320,5 @@ void destroy_toolcontext(struct cmd_context *cmd)
activation_exit();
fin_log();
fin_syslog();
reset_lvm_errno(0);
}