diff options
author | Diego Nehab <diego@tecgraf.puc-rio.br> | 2004-01-19 15:54:42 +0000 |
---|---|---|
committer | Diego Nehab <diego@tecgraf.puc-rio.br> | 2004-01-19 15:54:42 +0000 |
commit | 46d8f4eabe5e96a248a17a2f1583d61d9307a7d2 (patch) | |
tree | bbd2ff8bfb9e183d2608937bbfd08007f095aace | |
parent | f210508b2286dabfe53b1522ffad36eb8b823a3c (diff) | |
download | luasocket-46d8f4eabe5e96a248a17a2f1583d61d9307a7d2.tar.gz luasocket-46d8f4eabe5e96a248a17a2f1583d61d9307a7d2.tar.bz2 luasocket-46d8f4eabe5e96a248a17a2f1583d61d9307a7d2.zip |
Changed to be able to compile with -ansi and -pedantic!
Have to try in MacOS X again...
-rw-r--r-- | src/timeout.c | 3 | ||||
-rw-r--r-- | src/usocket.c | 6 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/timeout.c b/src/timeout.c index 0063378..df199a0 100644 --- a/src/timeout.c +++ b/src/timeout.c | |||
@@ -20,6 +20,9 @@ | |||
20 | #include <sys/time.h> | 20 | #include <sys/time.h> |
21 | #include <sys/times.h> | 21 | #include <sys/times.h> |
22 | #include <unistd.h> | 22 | #include <unistd.h> |
23 | #ifndef CLK_TCK | ||
24 | #define CLK_TCK (sysconf(_SC_CLK_TCK)); | ||
25 | #endif | ||
23 | #endif | 26 | #endif |
24 | 27 | ||
25 | /*=========================================================================*\ | 28 | /*=========================================================================*\ |
diff --git a/src/usocket.c b/src/usocket.c index 49ccdcb..f5939a9 100644 --- a/src/usocket.c +++ b/src/usocket.c | |||
@@ -16,6 +16,7 @@ | |||
16 | * RCS ID: $Id$ | 16 | * RCS ID: $Id$ |
17 | \*=========================================================================*/ | 17 | \*=========================================================================*/ |
18 | #include <string.h> | 18 | #include <string.h> |
19 | #include <signal.h> | ||
19 | 20 | ||
20 | #include "socket.h" | 21 | #include "socket.h" |
21 | 22 | ||
@@ -24,11 +25,14 @@ | |||
24 | \*-------------------------------------------------------------------------*/ | 25 | \*-------------------------------------------------------------------------*/ |
25 | int sock_open(void) | 26 | int sock_open(void) |
26 | { | 27 | { |
27 | /* instals a handler to ignore sigpipe or it will crash us */ | 28 | #if DOESNT_COMPILE_TRY_THIS |
28 | struct sigaction ignore; | 29 | struct sigaction ignore; |
29 | memset(&ignore, 0, sizeof(ignore)); | 30 | memset(&ignore, 0, sizeof(ignore)); |
30 | ignore.sa_handler = SIG_IGN; | 31 | ignore.sa_handler = SIG_IGN; |
31 | sigaction(SIGPIPE, &ignore, NULL); | 32 | sigaction(SIGPIPE, &ignore, NULL); |
33 | #endif | ||
34 | /* instals a handler to ignore sigpipe or it will crash us */ | ||
35 | signal(SIGPIPE, SIG_IGN); | ||
32 | return 1; | 36 | return 1; |
33 | } | 37 | } |
34 | 38 | ||