Changes by: antona
Update of /cvsroot/linux-ntfs/ntfsprogs/libntfs
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30180/libntfs
Modified Files:
logging.c
Log Message:
- Deal with missing syslog function by making code conditional on
presence of syslog.h header file (DOS/djgpp). (Christophe)
- Avoid clash with existing constants (OSX). (Christophe)
Index: logging.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/libntfs/logging.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -p -r1.10 -r1.11
--- logging.c 13 Feb 2006 01:23:31 -0000 1.10
+++ logging.c 22 Feb 2006 14:20:09 -0000 1.11
@@ -38,7 +38,9 @@
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
+#ifdef HAVE_SYSLOG_H
#include <syslog.h>
+#endif
#include "logging.h"
@@ -278,8 +280,10 @@ void ntfs_log_set_handler(ntfs_log_handl
{
if (handler) {
ntfs_log.handler = handler;
+#ifdef HAVE_SYSLOG_H
if (handler == ntfs_log_handler_syslog)
openlog("libntfs", LOG_PID, LOG_USER);
+#endif
} else
ntfs_log.handler = ntfs_log_handler_null;
}
@@ -337,6 +341,8 @@ int ntfs_log_redirect(const char *functi
* 0 Message wasn't logged
* num Number of output characters
*/
+
+#ifdef HAVE_SYSLOG_H
int ntfs_log_handler_syslog(const char *function __attribute__((unused)),
const char *file, __attribute__((unused)) int line, u32 level,
void *data __attribute__((unused)), const char *format, va_list args)
@@ -393,6 +399,7 @@ int ntfs_log_handler_syslog(const char *
errno = olderr;
return ret;
}
+#endif
/**
* ntfs_log_handler_fprintf - Basic logging handler
|