1
0
mirror of git://git.suckless.org/sbase synced 2024-12-23 15:34:38 +00:00
sbase/sleep.c
pancake da547fb294 add missing #include <getopt.h>
do not override CC in config.mk
2011-05-24 14:34:26 +02:00

22 lines
416 B
C

/* See LICENSE file for copyright and license details. */
#include <stdlib.h>
#include <unistd.h>
#include <getopt.h>
#include "util.h"
int
main(int argc, char *argv[])
{
unsigned int seconds;
if(getopt(argc, argv, "") != -1)
exit(EXIT_FAILURE);
if(optind != argc-1)
eprintf("usage: %s seconds\n", argv[0]);
seconds = atoi(argv[optind]);
while((seconds = sleep(seconds)) > 0)
;
return EXIT_SUCCESS;
}