summaryrefslogtreecommitdiff
path: root/fstests/timertest.c
diff options
context:
space:
mode:
authorNeal H. Walfield <neal@gnu.org>2002-03-26 19:00:56 +0000
committerNeal H. Walfield <neal@gnu.org>2002-03-26 19:00:56 +0000
commit9dca043e55824a0e7b30a44819928698aaedbb4d (patch)
treea0d410bf8452a9c6ce830ee1876c6ddceb386646 /fstests/timertest.c
parentdce31ee790321923f6e413fe516399866d70c954 (diff)
2002-03-23 James A. Morrison <ja2morri@uwaterloo.ca>
* fstests.c: Include <error.h>. (main): Use error, not perror. [HURDISH_TESTS]: Use this rather then having the code in question #if 0'd out. * timertest.c: Include <error.h> and <errno.h> (main): Use error, not perror and exit.
Diffstat (limited to 'fstests/timertest.c')
-rw-r--r--fstests/timertest.c18
1 files changed, 7 insertions, 11 deletions
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 <sys/time.h>
#include <stdio.h>
#include <stdlib.h>
+#include <errno.h>
+#include <error.h>
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)...");