aboutsummaryrefslogtreecommitdiff
path: root/libssh/options.c
diff options
context:
space:
mode:
authorAndreas Schneider <mail@cynapses.org>2009-04-02 16:33:28 +0000
committerAndreas Schneider <mail@cynapses.org>2009-04-02 16:33:28 +0000
commit2afc8a4f1cf4debd3b7437bc64554a1ab0e45fa9 (patch)
treead26c622ebed21829ada6477b2ebe63a6814d454 /libssh/options.c
parentda65ee4dbba6539ed92a28b5d6451b8f174ddcb8 (diff)
downloadlibssh-2afc8a4f1cf4debd3b7437bc64554a1ab0e45fa9.tar.gz
libssh-2afc8a4f1cf4debd3b7437bc64554a1ab0e45fa9.tar.xz
libssh-2afc8a4f1cf4debd3b7437bc64554a1ab0e45fa9.zip
Improve ssh_options_set_log_verbosity().
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@369 7dcaeef0-15fb-0310-b436-a5af3365683c
Diffstat (limited to 'libssh/options.c')
-rw-r--r--libssh/options.c32
1 files changed, 22 insertions, 10 deletions
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