From 9dca043e55824a0e7b30a44819928698aaedbb4d Mon Sep 17 00:00:00 2001 From: "Neal H. Walfield" Date: Tue, 26 Mar 2002 19:00:56 +0000 Subject: 2002-03-23 James A. Morrison * fstests.c: Include . (main): Use error, not perror. [HURDISH_TESTS]: Use this rather then having the code in question #if 0'd out. * timertest.c: Include and (main): Use error, not perror and exit. --- fstests/timertest.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'fstests/timertest.c') diff --git a/fstests/timertest.c b/fstests/timertest.c index a2c8a7da..2d602560 100644 --- a/fstests/timertest.c +++ b/fstests/timertest.c @@ -1,5 +1,5 @@ -/* - Copyright (C) 1994, 2001 Free Software Foundation, Inc. +/* A test for the Hurd timer and getchar + Copyright (C) 1994,2001,02 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -19,6 +19,8 @@ #include #include #include +#include +#include void alarm_handler (int signo) @@ -28,7 +30,7 @@ alarm_handler (int signo) } int -main() +main(int argc, char *argv[]) { struct itimerval real_timer; @@ -40,10 +42,7 @@ main() signal (SIGALRM, alarm_handler); if (setitimer (ITIMER_REAL, &real_timer, 0) < 0) - { - perror ("Setting timer"); - exit (1); - } + error (1, errno, "Setting timer"); while (1) { @@ -52,10 +51,7 @@ main() fflush (stdout); c = getchar (); if (ferror (stdin)) - { - perror ("getchar"); - exit (1); - } + error (1, errno, "getchar"); if (c == EOF) { puts ("Saw EOF. Pausing (no input)..."); -- cgit v1.2.3