From edeba9c4b419195914633b22ec910086ea4d31f3 Mon Sep 17 00:00:00 2001 From: Elliott Pardee Date: Sat, 13 Jun 2015 20:20:25 -0400 Subject: [PATCH] Update typeprint.c --- c/typeprint.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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;