add_def SOLARIS
echo "Configuring for Solaris (" $SYSTEM "SunOS version" $VERSION ")"
;;
- CYGWIN32_NT-i[3456]86 )
- EXTRA_OBJECTS="sys_winnt.o"
- EXTRA_LIBS=""
- add_def WINNT
- echo "Configuring for Windows NT (Cygwin32)"
- ;;
* )
echo "Sorry, I don't know how to build this software on your system."
exit 1
#define DEBUG_LEVEL_PRINT_DEBUG 2
static int debug_level = 0;
-#ifdef WINNT
-static FILE *logfile;
-#endif
-
struct LogFile {
const char *name;
const char *banner;
LOG_Initialise(void)
{
initialised = 1;
-
-#ifdef WINNT
- logfile = fopen("./chronyd.err", "a");
-#endif
}
/* ================================================== */
void
LOG_Finalise(void)
{
-#ifdef WINNT
- if (logfile) {
- fclose(logfile);
- }
-#else
if (system_log) {
closelog();
}
-#endif
LOG_CycleLogFiles();
static void log_message(int fatal, LOG_Severity severity, const char *message)
{
-#ifdef WINNT
- if (logfile) {
- fprintf(logfile, fatal ? "Fatal error : %s\n" : "%s\n", message);
- }
-#else
if (system_log) {
int priority;
switch (severity) {
} else {
fprintf(stderr, fatal ? "Fatal error : %s\n" : "%s\n", message);
}
-#endif
}
/* ================================================== */
time_t t;
struct tm stm;
-#ifdef WINNT
-#else
if (!system_log) {
/* Don't clutter up syslog with timestamps and internal debugging info */
time(&t);
if (debug_level >= DEBUG_LEVEL_PRINT_FUNCTION)
fprintf(stderr, "%s:%d:(%s) ", filename, line_number, function_name);
}
-#endif
va_start(other_args, format);
vsnprintf(buf, sizeof(buf), format, other_args);
void
LOG_OpenSystemLog(void)
{
-#ifdef WINNT
-#else
system_log = 1;
openlog("chronyd", LOG_PID, LOG_DAEMON);
-#endif
}
/* ================================================== */
static void
go_daemon(void)
{
-#ifdef WINNT
-
-
-#else
-
int pid, fd, pipefd[2];
/* Create pipe which will the daemon use to notify the grandparent
LOG_SetParentFd(pipefd[1]);
}
}
-
-#endif
}
/* ================================================== */
#include <nlist.h>
#endif
-#if defined (WINNT)
-
-/* Designed to work with the GCC from the GNAT-3.10 for Win32
- distribution */
-
-#define Win32_Winsock
-#include <assert.h>
-#include <ctype.h>
-
-#if 1
-/* Cheat and inline the necessary bits from <errno.h>. We don't
- include it directly because it redefines some EXXX constants that
- conflict with <windows32/sockets.h> (included by <windows.h>) */
-
-int* _errno();
-int* __doserrno();
-
-#define errno (*_errno())
-#define _doserrno (*__doserrno())
-
-#define ENOENT 2
-#else
-
-#include <errno.h>
-#endif
-
-
-#include <float.h>
-#include <math.h>
-#include <signal.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <time.h>
-#include <windows.h>
-#endif
-
#endif /* GOT_SYSINCL_H */