From 1e45c6bafc8419930958103cc1651ff86cf5d84d Mon Sep 17 00:00:00 2001 From: Miller Puckette Date: Fri, 20 Jul 2007 03:25:21 +0000 Subject: various bug fixes. svn path=/trunk/; revision=8186 --- pd/src/s_inter.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'pd/src/s_inter.c') diff --git a/pd/src/s_inter.c b/pd/src/s_inter.c index 4b73e8d1..e6c69bf6 100644 --- a/pd/src/s_inter.c +++ b/pd/src/s_inter.c @@ -23,16 +23,19 @@ that didn't really belong anywhere. */ #ifdef HAVE_BSTRING_H #include #endif -#ifdef MSW +#ifdef _WIN32 #include #include #include #include #include +# ifdef _MSC_VER typedef int pid_t; +# endif typedef int socklen_t; #define EADDRINUSE WSAEADDRINUSE #endif + #include #include #include @@ -150,13 +153,15 @@ double sys_getrealtime(void) #endif } +extern int sys_nosleep; + static int sys_domicrosleep(int microsec, int pollem) { struct timeval timout; int i, didsomething = 0; t_fdpoll *fp; timout.tv_sec = 0; - timout.tv_usec = microsec; + timout.tv_usec = (sys_nosleep ? 0 : microsec); if (pollem) { fd_set readset, writeset, exceptset; @@ -1153,8 +1158,8 @@ int sys_startgui(const char *guidir) to make it timeshare with the rest of the system. (Version 0.33P2 : if there's no GUI, the watchdog pinging is done from the scheduler idle routine in this process instead.) */ - int pipe9[2], watchpid; + if (pipe(pipe9) < 0) { seteuid(getuid()); /* lose setuid priveliges */ -- cgit v1.2.1