k9core

Unnamed repository
Log | Files | Refs | LICENSE

commit 02699d5c8f0d773a2f1aac06de95f0072966399f
parent fbacc8d7c5424c1d73b6132f78d17fb29b72a1ff
Author: call-cc <callcc@vxempire.xyz>
Date:   Tue,  2 Jun 2020 19:54:32 -0400

Add error alert to ln and another item to the todo

Diffstat:
MTODO.org | 1+
Msrc/ln.c | 7++++++-
2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/TODO.org b/TODO.org @@ -11,3 +11,4 @@ - [ ] rm - [ ] touch - [X] yes +- [ ] Add error handling and returning for ln diff --git a/src/ln.c b/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);