diff options
author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2019-03-28 20:13:01 +0100 |
---|---|---|
committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2019-03-28 20:13:01 +0100 |
commit | 1101d2fa0eb14baab50cc5c6cf63078930c06290 (patch) | |
tree | e1469273c2f14b99e1cb20fe8f369b52260a9d26 /src | |
parent | 42b215a865c2645dcbffc641e9cac1505a1b4cee (diff) | |
download | blogc-1101d2fa0eb14baab50cc5c6cf63078930c06290.tar.gz blogc-1101d2fa0eb14baab50cc5c6cf63078930c06290.tar.bz2 blogc-1101d2fa0eb14baab50cc5c6cf63078930c06290.zip |
blogc: -p should return special code when variable not found
Diffstat (limited to 'src')
-rw-r--r-- | src/blogc/main.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/blogc/main.c b/src/blogc/main.c index 7416994..bae3c80 100644 --- a/src/blogc/main.c +++ b/src/blogc/main.c @@ -14,6 +14,12 @@ #include <sys/stat.h> #endif /* HAVE_SYS_STAT_H */ +#ifdef HAVE_SYSEXITS_H +#include <sysexits.h> +#else +#define EX_CONFIG 78 +#endif /* HAVE_SYSEXITS_H */ + #include <errno.h> #include <locale.h> #include <stdbool.h> @@ -301,7 +307,7 @@ main(int argc, char **argv) if (val == NULL) { fprintf(stderr, "blogc: error: variable not found: %s\n", print); - rv = 1; + rv = EX_CONFIG; } else { printf("%s\n", val); |