Add arg.h-handling to sync(1) and unlink(1)

This commit is contained in:
FRIGN 2015-02-08 22:13:50 +01:00
parent 3e7c549862
commit 8798b8a867
2 changed files with 14 additions and 4 deletions

7
sync.c
View File

@ -12,7 +12,12 @@ usage(void)
int
main(int argc, char *argv[])
{
if (argc != 1)
ARGBEGIN {
default:
usage();
} ARGEND;
if (argc)
usage();
sync();

View File

@ -12,11 +12,16 @@ usage(void)
int
main(int argc, char *argv[])
{
if (argc != 2)
ARGBEGIN {
default:
usage();
} ARGEND;
if (argc != 1)
usage();
if (unlink(argv[1]) < 0)
eprintf("unlink: '%s':", argv[1]);
if (unlink(argv[0]) < 0)
eprintf("unlink: '%s':", argv[0]);
return 0;
}