From 4bc695063294c93fdff87371b988a334cbac2d37 Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Tue, 15 Sep 2015 18:12:32 +0200 Subject: [PATCH] drop WINNT-specific code This was never really supported and it would probably require a lot of work to get a usable chronyd in Cygwin. Remove all WINNT-specific code. --- configure | 6 ------ logging.c | 26 -------------------------- main.c | 7 ------- sysincl.h | 39 --------------------------------------- 4 files changed, 78 deletions(-) diff --git a/configure b/configure index 03b9f13..c634711 100755 --- a/configure +++ b/configure @@ -440,12 +440,6 @@ case $SYSTEM in 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 diff --git a/logging.c b/logging.c index 0ffaa29..d9685f1 100644 --- a/logging.c +++ b/logging.c @@ -48,10 +48,6 @@ static int parent_fd = 0; #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; @@ -73,10 +69,6 @@ void LOG_Initialise(void) { initialised = 1; - -#ifdef WINNT - logfile = fopen("./chronyd.err", "a"); -#endif } /* ================================================== */ @@ -85,15 +77,9 @@ LOG_Initialise(void) void LOG_Finalise(void) { -#ifdef WINNT - if (logfile) { - fclose(logfile); - } -#else if (system_log) { closelog(); } -#endif LOG_CycleLogFiles(); @@ -104,11 +90,6 @@ LOG_Finalise(void) 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) { @@ -134,7 +115,6 @@ static void log_message(int fatal, LOG_Severity severity, const char *message) } else { fprintf(stderr, fatal ? "Fatal error : %s\n" : "%s\n", message); } -#endif } /* ================================================== */ @@ -148,8 +128,6 @@ void LOG_Message(LOG_Severity severity, LOG_Facility facility, 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); @@ -159,7 +137,6 @@ void LOG_Message(LOG_Severity severity, LOG_Facility facility, 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); @@ -197,11 +174,8 @@ void LOG_Message(LOG_Severity severity, LOG_Facility facility, void LOG_OpenSystemLog(void) { -#ifdef WINNT -#else system_log = 1; openlog("chronyd", LOG_PID, LOG_DAEMON); -#endif } /* ================================================== */ diff --git a/main.c b/main.c index 83f0c4a..5626e86 100644 --- a/main.c +++ b/main.c @@ -275,11 +275,6 @@ write_lockfile(void) static void go_daemon(void) { -#ifdef WINNT - - -#else - int pid, fd, pipefd[2]; /* Create pipe which will the daemon use to notify the grandparent @@ -338,8 +333,6 @@ go_daemon(void) LOG_SetParentFd(pipefd[1]); } } - -#endif } /* ================================================== */ diff --git a/sysincl.h b/sysincl.h index 4976e97..31d28ad 100644 --- a/sysincl.h +++ b/sysincl.h @@ -91,43 +91,4 @@ #include #endif -#if defined (WINNT) - -/* Designed to work with the GCC from the GNAT-3.10 for Win32 - distribution */ - -#define Win32_Winsock -#include -#include - -#if 1 -/* Cheat and inline the necessary bits from . We don't - include it directly because it redefines some EXXX constants that - conflict with (included by ) */ - -int* _errno(); -int* __doserrno(); - -#define errno (*_errno()) -#define _doserrno (*__doserrno()) - -#define ENOENT 2 -#else - -#include -#endif - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#endif - #endif /* GOT_SYSINCL_H */