diff --git a/src/utils_debug.c b/src/utils_debug.c
index db59525e3f94a5497dd56597c98266ce54b52498..9fc9040b23ff74ee16be33305174d9cada4e1fe7 100644 (file)
--- a/src/utils_debug.c
+++ b/src/utils_debug.c
/**
* collectd - src/utils_debug.c
/**
* collectd - src/utils_debug.c
- * Copyright (C) 2005 Niki W. Waibel
+ * Copyright (C) 2005,2006 Niki W. Waibel
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
#include "common.h"
#include "utils_debug.h"
#include "common.h"
#include "utils_debug.h"
-/* *** *** *** global variables *** *** *** */
#if COLLECT_DEBUG
#if COLLECT_DEBUG
-#define DEFAULT_FILENAME "collectd.log"
-
static void cu_vdebug(const char *file, int line, const char *func,
const char *format, va_list ap);
/* if preemptive threads are used, these vars need some sort of locking! */
static void cu_vdebug(const char *file, int line, const char *func,
const char *format, va_list ap);
/* if preemptive threads are used, these vars need some sort of locking! */
-/* pth is non-preemptive, so no locking is necessary (?) */
+/* pth is non-preemptive, so no locking is necessary */
static FILE *cu_debug_file = NULL;
static char *cu_debug_filename = NULL;
static FILE *cu_debug_file = NULL;
static char *cu_debug_filename = NULL;
int
cu_debug_startfile(const char *file, int line, const char *func,
int
cu_debug_startfile(const char *file, int line, const char *func,
- const char *format, ...)
+ const char *filename, const char *format, ...)
{
va_list ap;
{
va_list ap;
}
if(cu_debug_filename == NULL) {
}
if(cu_debug_filename == NULL) {
- cu_debug_filename = sstrdup(DEFAULT_FILENAME);
+ cu_debug_filename = sstrdup(filename);
}
cu_debug_file = fopen(cu_debug_filename, "a");
}
cu_debug_file = fopen(cu_debug_filename, "a");
} /* int cu_debug_resetfile(const char *file, int line, const char *func,
const char *filename) */
} /* int cu_debug_resetfile(const char *file, int line, const char *func,
const char *filename) */
-#else /* !COLLECT_DEBUG */
-
-void
-cu_debug(const char *file, int line, const char *func, const char *format, ...)
-{
-}
-int
-cu_debug_startfile(const char *file, int line, const char *func, const char *format, ...)
-{
- return EXIT_SUCCESS;
-}
-int
-cu_debug_stopfile(const char *file, int line, const char *func, const char *format, ...)
-{
- return EXIT_SUCCESS;
-}
-int
-cu_debug_resetfile(const char *file, int line, const char *func, const char *filename)
-{
- return EXIT_SUCCESS;
-}
-
#endif /* COLLECT_DEBUG */
#endif /* COLLECT_DEBUG */