From 89a3b2fabd2e5727687c714e9e9669ac089965d4 Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Wed, 4 May 1994 17:59:11 +0000 Subject: Formerly timertest.c.~2~ --- fstests/timertest.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'fstests') diff --git a/fstests/timertest.c b/fstests/timertest.c index db19f4d6..9f3ae74f 100644 --- a/fstests/timertest.c +++ b/fstests/timertest.c @@ -15,18 +15,21 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include +#include +#include -int -alarm_handler () +void +alarm_handler (int signo) { printf ("Received alarm\n"); fflush (stdout); } +int main() { struct itimerval real_timer; - error_t err; real_timer.it_interval.tv_usec = 0; real_timer.it_interval.tv_sec = 1; @@ -35,8 +38,12 @@ main() signal (SIGALRM, alarm_handler); - err = setitimer (ITIMER_REAL, &real_timer, 0); - + if (setitimer (ITIMER_REAL, &real_timer, 0) < 0) + { + perror ("Setting timer"); + exit (1); + } + while (1) { printf ("Pausing\n"); -- cgit v1.2.3