Remeoved alarm() function for Windows

This commit is contained in:
Stefan Ritt 2014-01-13 08:56:32 +01:00
parent d153ab0ba0
commit 15ecf9fe52
2 changed files with 8 additions and 2 deletions

View File

@ -144,7 +144,7 @@
<BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation> <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\mxml\mxml.c"> <ClCompile Include="..\..\mxml\mxml.c">
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">HAVE_STRLCPY;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile> </ClCompile>
<ClCompile Include="..\src\regex.c"> <ClCompile Include="..\src\regex.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel> <WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>

View File

@ -28530,12 +28530,16 @@ void hup_handler(int sig)
_hup = TRUE; _hup = TRUE;
} }
#ifndef OS_WINNT
void alarm_handler(int sig) void alarm_handler(int sig)
{ {
if (sig) if (sig)
alarm(3); alarm(3);
} }
#endif
/*------------------------------------------------------------------*/ /*------------------------------------------------------------------*/
#ifdef HAVE_SSL #ifdef HAVE_SSL
@ -28790,8 +28794,10 @@ void server_loop(void)
alarm_handle.sa_flags = 0; alarm_handle.sa_flags = 0;
sigaction(SIGALRM, &alarm_handle, NULL); sigaction(SIGALRM, &alarm_handle, NULL);
#ifndef OS_WINNT
alarm(3); // prevents blocking send() operations alarm(3); // prevents blocking send() operations
#endif
/* give up root privilege */ /* give up root privilege */
if (geteuid() == 0) { if (geteuid() == 0) {
if (!getcfg("global", "Grp", str, sizeof(str)) || setegroup(str) < 0) { if (!getcfg("global", "Grp", str, sizeof(str)) || setegroup(str) < 0) {