Add error alert to ln and another item to the todo

This commit is contained in:
call-cc 2020-06-02 19:54:32 -04:00
parent fbacc8d7c5
commit 02699d5c8f
2 changed files with 7 additions and 1 deletions

View File

@ -11,3 +11,4 @@
- [ ] rm
- [ ] touch
- [X] yes
- [ ] Add error handling and returning for ln

View File

@ -20,7 +20,12 @@ main(int argc, char *argv[])
case 's':
if(fflag && (access(argv[3], F_OK) != 1))
unlink(argv[3]);
symlink(argv[2],argv[3]);
int symstat = symlink(argv[2],argv[3]);
if(symstat == -1)
{
fprintf(stderr, "Symlink error!");
return 1;
}
break;
case '?':
printf("-%c: Argument not found", optopt);