From 46d8f4eabe5e96a248a17a2f1583d61d9307a7d2 Mon Sep 17 00:00:00 2001 From: Diego Nehab Date: Mon, 19 Jan 2004 15:54:42 +0000 Subject: [PATCH] Changed to be able to compile with -ansi and -pedantic! Have to try in MacOS X again... --- src/timeout.c | 3 +++ src/usocket.c | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) 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 @@ #include #include #include +#ifndef CLK_TCK +#define CLK_TCK (sysconf(_SC_CLK_TCK)); +#endif #endif /*=========================================================================*\ 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 @@ * RCS ID: $Id$ \*=========================================================================*/ #include +#include #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; }