diff --git a/c/typeprint.c b/c/typeprint.c index fb20cbd..d65820b 100644 --- a/c/typeprint.c +++ b/c/typeprint.c @@ -1,10 +1,10 @@ /* vypr's typeprint */ /* https://github.com/vypr/typeprint */ +#include #include #include #include -#include #include static int process(char *name); @@ -19,13 +19,11 @@ process(char *name) ts.tv_nsec = 10 * 1000000; if (access(name, F_OK) == -1) { - fprintf(stderr, "[err] no such file or directory\n"); - return ENOENT; + errx(ENOENT, "[err] no such file or directory\n"); } if (access(name, R_OK) == -1) { - fprintf(stderr, "[err] can't read file, permission denied\n"); - return EACCES; + errx(EACCES, "[err] can't read file, permission denied\n"); } int x;