mirror of
https://github.com/lunarmodules/luasocket.git
synced 2024-12-27 04:48:21 +01:00
Changed to be able to compile with -ansi and -pedantic!
Have to try in MacOS X again...
This commit is contained in:
parent
f210508b22
commit
46d8f4eabe
@ -20,6 +20,9 @@
|
|||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/times.h>
|
#include <sys/times.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#ifndef CLK_TCK
|
||||||
|
#define CLK_TCK (sysconf(_SC_CLK_TCK));
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*=========================================================================*\
|
/*=========================================================================*\
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
* RCS ID: $Id$
|
* RCS ID: $Id$
|
||||||
\*=========================================================================*/
|
\*=========================================================================*/
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <signal.h>
|
||||||
|
|
||||||
#include "socket.h"
|
#include "socket.h"
|
||||||
|
|
||||||
@ -24,11 +25,14 @@
|
|||||||
\*-------------------------------------------------------------------------*/
|
\*-------------------------------------------------------------------------*/
|
||||||
int sock_open(void)
|
int sock_open(void)
|
||||||
{
|
{
|
||||||
/* instals a handler to ignore sigpipe or it will crash us */
|
#if DOESNT_COMPILE_TRY_THIS
|
||||||
struct sigaction ignore;
|
struct sigaction ignore;
|
||||||
memset(&ignore, 0, sizeof(ignore));
|
memset(&ignore, 0, sizeof(ignore));
|
||||||
ignore.sa_handler = SIG_IGN;
|
ignore.sa_handler = SIG_IGN;
|
||||||
sigaction(SIGPIPE, &ignore, NULL);
|
sigaction(SIGPIPE, &ignore, NULL);
|
||||||
|
#endif
|
||||||
|
/* instals a handler to ignore sigpipe or it will crash us */
|
||||||
|
signal(SIGPIPE, SIG_IGN);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user