summaryrefslogtreecommitdiff
path: root/lib/log.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/log.c')
-rw-r--r--lib/log.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/lib/log.c b/lib/log.c
index 2738e18..ecc47a8 100644
--- a/lib/log.c
+++ b/lib/log.c
@@ -29,9 +29,6 @@
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#define _SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE >= 500 || \
- _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED || \
- /* Since glibc 2.12: */ _POSIX_C_SOURCE >= 200809L
#include <unistd.h>
#include <stdio.h>
@@ -111,12 +108,12 @@ void log_init(const char * name, int isdaemon, int verbose)
if (!logpriv)
return;
- if (name != NULL)
+ if (name)
logpriv->name = strdup(name);
else
logpriv->name = strdup(LOG_NAME_DEFAULT);
- if (logpriv->name == NULL)
+ if (!logpriv->name)
fprintf(stderr, "ipmitool: malloc failure\n");
logpriv->daemon = isdaemon;
@@ -147,13 +144,8 @@ void log_halt(void)
logpriv = NULL;
}
-int log_level_get(void)
+void log_level_set(int verbose)
{
- return logpriv->level;
-}
-
-void log_level_set(int level)
-{
- logpriv->level = level;
+ logpriv->level = verbose + LOG_NOTICE;
}