Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 1 | #include "internal.h" |
| 2 | #include <stdio.h> |
| 3 | |
Eric Andersen | 3cf52d1 | 1999-10-12 22:26:06 +0000 | [diff] [blame^] | 4 | const char sleep_usage[] = " NUMBER\n" |
| 5 | "Pause for NUMBER seconds.\n"; |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 6 | |
| 7 | extern int |
Eric Andersen | 3cf52d1 | 1999-10-12 22:26:06 +0000 | [diff] [blame^] | 8 | sleep_main(int argc, char * * argv) |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 9 | { |
Eric Andersen | 3cf52d1 | 1999-10-12 22:26:06 +0000 | [diff] [blame^] | 10 | 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 Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 20 | } |