blob: 53fe5a0c2bf8b6085a208ee9c83bb2b53a54c627 [file] [log] [blame]
Eric Andersencc8ed391999-10-05 16:24:54 +00001#include "internal.h"
2#include <stdio.h>
3
Eric Andersen3cf52d11999-10-12 22:26:06 +00004const char sleep_usage[] = " NUMBER\n"
5"Pause for NUMBER seconds.\n";
Eric Andersencc8ed391999-10-05 16:24:54 +00006
7extern int
Eric Andersen3cf52d11999-10-12 22:26:06 +00008sleep_main(int argc, char * * argv)
Eric Andersencc8ed391999-10-05 16:24:54 +00009{
Eric Andersen3cf52d11999-10-12 22:26:06 +000010 if ( (argc < 2) || (**(argv+1) == '-') ) {
11 fprintf(stderr, "Usage: %s %s", *argv, sleep_usage);
12 exit(FALSE);
13 }
14
15 if ( sleep(atoi(*(++argv))) != 0 ) {
16 perror( "sleep");
17 exit (FALSE);
18 } else
19 exit (TRUE);
Eric Andersencc8ed391999-10-05 16:24:54 +000020}