Remove native win32 support. We have no report that LCDproc can be natively
compiled and used with recent Windows systems (Windows Vista/7). Except for serial drivers (and those using USB->serial adapters) drivers are not expected to work with those systems.
This commit is contained in:
+2
-58
@@ -20,7 +20,6 @@
|
||||
* 2001, Rene Wagner
|
||||
* 2002, Mike Patnode
|
||||
* 2002, Guillaume Filion
|
||||
* 2003, Benjamin Tse (Win32 support)
|
||||
* 2005-2006, Peter Marschall (cleanup)
|
||||
*/
|
||||
|
||||
@@ -34,10 +33,8 @@
|
||||
#include <strings.h>
|
||||
#include <signal.h>
|
||||
#include <unistd.h>
|
||||
#ifndef WIN32
|
||||
# include <pwd.h>
|
||||
# include <sys/wait.h>
|
||||
#endif
|
||||
#include <pwd.h>
|
||||
#include <sys/wait.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <math.h>
|
||||
@@ -542,7 +539,6 @@ set_default_settings(void)
|
||||
static void
|
||||
install_signal_handlers(int allow_reload)
|
||||
{
|
||||
#ifndef WIN32
|
||||
/* Installs signal handlers so that the program does clean exit and
|
||||
* can also receive a reload signal.
|
||||
* sigaction() is favoured over signal() */
|
||||
@@ -574,15 +570,6 @@ install_signal_handlers(int allow_reload)
|
||||
/* Treat this signal just like INT and TERM */
|
||||
}
|
||||
sigaction(SIGHUP, &sa, NULL);
|
||||
#else
|
||||
/* Win32 does not support POSIX signals i.e. sigaction(). However, it does
|
||||
* support ANSI signals in mingw. */
|
||||
signal(SIGINT, exit_program); /* Ctrl-C will cause a clean exit...*/
|
||||
signal(SIGTERM, exit_program); /* and "kill"...*/
|
||||
signal(SIGPIPE, SIG_IGN);
|
||||
|
||||
/* REVISIT: implement SIGHUP on windows */
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -601,13 +588,6 @@ child_ok_func(int signal)
|
||||
static pid_t
|
||||
daemonize(void)
|
||||
{
|
||||
#ifdef WIN32
|
||||
/* WIN32 does not support fork() - CreateProcess() does not even have
|
||||
* similar functionality. Instead don't daemonize on WIN32.
|
||||
*/
|
||||
pid_t parent;
|
||||
parent = getpid();
|
||||
#else
|
||||
pid_t child;
|
||||
pid_t parent;
|
||||
int child_status;
|
||||
@@ -659,7 +639,6 @@ daemonize(void)
|
||||
|
||||
setsid(); /* Create a new session because otherwise we'll
|
||||
* catch a SIGHUP when the shell is closed. */
|
||||
#endif
|
||||
|
||||
return parent;
|
||||
}
|
||||
@@ -668,11 +647,9 @@ daemonize(void)
|
||||
static int
|
||||
wave_to_parent(pid_t parent_pid)
|
||||
{
|
||||
#ifndef WIN32
|
||||
debug(RPT_DEBUG, "%s(parent_pid=%d)", __FUNCTION__, parent_pid);
|
||||
|
||||
kill(parent_pid, SIGUSR1);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -722,7 +699,6 @@ init_drivers(void)
|
||||
static int
|
||||
drop_privs(char *user)
|
||||
{
|
||||
#ifndef WIN32
|
||||
struct passwd *pwent;
|
||||
|
||||
debug(RPT_DEBUG, "%s(user=\"%.40s\")", __FUNCTION__, user);
|
||||
@@ -738,9 +714,6 @@ drop_privs(char *user)
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
/* Don't alter privileges in WIN32 */
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -782,14 +755,8 @@ static void
|
||||
do_mainloop(void)
|
||||
{
|
||||
Screen *s;
|
||||
#ifndef WIN32
|
||||
struct timeval t;
|
||||
struct timeval last_t;
|
||||
#else
|
||||
LARGE_INTEGER t;
|
||||
LARGE_INTEGER last_t;
|
||||
LARGE_INTEGER perf_freq; /* frequency of high perf counter (cycles per usec) */
|
||||
#endif
|
||||
int sleeptime;
|
||||
long int process_lag = 0;
|
||||
long int render_lag = 0;
|
||||
@@ -797,20 +764,11 @@ do_mainloop(void)
|
||||
|
||||
debug(RPT_DEBUG, "%s()", __FUNCTION__);
|
||||
|
||||
#ifndef WIN32
|
||||
gettimeofday(&t, NULL); /* Get initial time */
|
||||
#else
|
||||
QueryPerformanceFrequency(&perf_freq);
|
||||
/* scale perf_freq to number of cycles per micro-sec */
|
||||
/* REVISIT: this causes rounding errors below but is more efficient */
|
||||
perf_freq.QuadPart /= 1e6;
|
||||
QueryPerformanceCounter(&t);
|
||||
#endif
|
||||
|
||||
while (1) {
|
||||
/* Get current time */
|
||||
last_t = t;
|
||||
#ifndef WIN32
|
||||
gettimeofday(&t, NULL);
|
||||
t_diff = t.tv_sec - last_t.tv_sec;
|
||||
if ( ((t_diff + 1) > (LONG_MAX / 1e6)) || (t_diff < 0) ) {
|
||||
@@ -822,15 +780,6 @@ do_mainloop(void)
|
||||
t_diff *= 1e6;
|
||||
t_diff += t.tv_usec - last_t.tv_usec;
|
||||
}
|
||||
#else
|
||||
QueryPerformanceCounter(&t);
|
||||
/*t_diff.HighPart = t.HighPart - last_t.HighPart;
|
||||
t_diff.LowPart = t.LowPart - last_t.LowPart;
|
||||
*/
|
||||
t_diff = t.QuadPart - last_t.QuadPart;
|
||||
t_diff /= perf_freq.QuadPart; /* scale to microseconds */
|
||||
/* REVISIT: assumes fits into long */
|
||||
#endif
|
||||
process_lag += t_diff;
|
||||
if (process_lag > 0) {
|
||||
/* Time for a processing stroke */
|
||||
@@ -870,12 +819,7 @@ do_mainloop(void)
|
||||
/* Sleep just as long as needed */
|
||||
sleeptime = min(0-process_lag, 0-render_lag);
|
||||
if (sleeptime > 0) {
|
||||
#ifndef WIN32
|
||||
usleep(sleeptime);
|
||||
#else
|
||||
/* Sleep in Windows takes milliseconds argument */
|
||||
Sleep(sleeptime / 1000);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Check if a SIGHUP has been caught */
|
||||
|
||||
Reference in New Issue
Block a user