Add error alert to ln and another item to the todo
This commit is contained in:
parent
fbacc8d7c5
commit
02699d5c8f
1
TODO.org
1
TODO.org
|
@ -11,3 +11,4 @@
|
|||
- [ ] rm
|
||||
- [ ] touch
|
||||
- [X] yes
|
||||
- [ ] Add error handling and returning for ln
|
||||
|
|
7
src/ln.c
7
src/ln.c
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue