Changed to be able to compile with -ansi and -pedantic!

Have to try in MacOS X again...
This commit is contained in:
Diego Nehab 2004-01-19 15:54:42 +00:00
parent f210508b22
commit 46d8f4eabe
2 changed files with 8 additions and 1 deletions

View File

@ -20,6 +20,9 @@
#include <sys/time.h>
#include <sys/times.h>
#include <unistd.h>
#ifndef CLK_TCK
#define CLK_TCK (sysconf(_SC_CLK_TCK));
#endif
#endif
/*=========================================================================*\

View File

@ -16,6 +16,7 @@
* RCS ID: $Id$
\*=========================================================================*/
#include <string.h>
#include <signal.h>
#include "socket.h"
@ -24,11 +25,14 @@
\*-------------------------------------------------------------------------*/
int sock_open(void)
{
/* instals a handler to ignore sigpipe or it will crash us */
#if DOESNT_COMPILE_TRY_THIS
struct sigaction ignore;
memset(&ignore, 0, sizeof(ignore));
ignore.sa_handler = SIG_IGN;
sigaction(SIGPIPE, &ignore, NULL);
#endif
/* instals a handler to ignore sigpipe or it will crash us */
signal(SIGPIPE, SIG_IGN);
return 1;
}