From 2afc8a4f1cf4debd3b7437bc64554a1ab0e45fa9 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 2 Apr 2009 16:33:28 +0000 Subject: Improve ssh_options_set_log_verbosity(). git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@369 7dcaeef0-15fb-0310-b436-a5af3365683c --- libssh/options.c | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) (limited to 'libssh/options.c') diff --git a/libssh/options.c b/libssh/options.c index c9b938d..3bbf559 100644 --- a/libssh/options.c +++ b/libssh/options.c @@ -740,17 +740,29 @@ int ssh_options_set_log_function(SSH_OPTIONS *opt, return 0; } -/** \brief set this session's logging priority - * \param opt options structure - * \param verbosity verbosity of the messages. Every log smaller or equal to verbosity will be shown\n - * SSH_LOG_NOLOG No logging \n - * SSH_LOG_RARE Rare conditions or warnings\n - * SSH_LOG_ENTRY Api-accessible entrypoints\n - * SSH_LOG_PACKET Packet id and size\n - * SSH_LOG_FUNCTIONS function entering and leaving\n +/** + * @brief Set the session logging priority. + * + * @param opt The options structure to use. + * + * @param verbosity The verbosity of the messages. Every log smaller or + * equal to verbosity will be shown\n + * SSH_LOG_NOLOG No logging \n + * SSH_LOG_RARE Rare conditions or warnings\n + * SSH_LOG_ENTRY Api-accessible entrypoints\n + * SSH_LOG_PACKET Packet id and size\n + * SSH_LOG_FUNCTIONS function entering and leaving\n + * + * @return 0 on success, < 0 on error. */ -void ssh_options_set_log_verbosity(SSH_OPTIONS *opt, int verbosity){ - opt->log_verbosity=verbosity; +int ssh_options_set_log_verbosity(SSH_OPTIONS *opt, int verbosity) { + if (opt == NULL) { + return -1; + } + + opt->log_verbosity = verbosity; + + return 0; } /** * This is a helper for your application to generate the appropriate -- cgit