solaris-fixes branch: Applied the swap-patch by Christophe Kalt.
[collectd.git] / src / utils_debug.c
index 3f432e1..9fc9040 100644 (file)
@@ -1,39 +1,35 @@
 /**
  * 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 Li-
- * cence as published by the Free Software Foundation; either
- * version 2 of the Licence, or any later version.
+ * 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
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
  *
- * This program is distributed in the hope that it will be use-
- * ful, but WITHOUT ANY WARRANTY; without even the implied war-
- * ranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public Licence for more details.
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
  *
- * You should have received a copy of the GNU General Public
- * Licence along with this program; if not, write to the Free
- * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
- * USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  *
- * Author:
- *   Niki W. Waibel <niki.waibel@gmx.net>
-**/
+ * Authors:
+ *   Niki W. Waibel <niki.waibel at gmx.net>
+ **/
 
 #include "common.h"
 #include "utils_debug.h"
 
-/* *** *** ***   global variables   *** *** *** */
 #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! */
-/* 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;
 
@@ -72,7 +68,7 @@ cu_debug(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;
 
@@ -83,7 +79,7 @@ cu_debug_startfile(const char *file, int line, const char *func,
        }
 
        if(cu_debug_filename == NULL) {
-               cu_debug_filename = sstrdup(DEFAULT_FILENAME);
+               cu_debug_filename = sstrdup(filename);
        }
 
        cu_debug_file = fopen(cu_debug_filename, "a");
@@ -170,27 +166,5 @@ cu_debug_resetfile(const char *file, int line, const char *func,
 } /* 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 */