From 2c268e502b56c7593d9d2d2bf5f63cc2d0852ffc Mon Sep 17 00:00:00 2001 From: June McEnroe Date: Thu, 15 Sep 2016 23:05:57 -0400 Subject: Use sysexits.h in xx --- .bin/xx.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.bin/xx.c b/.bin/xx.c index 5ee22f6f..9b8f5d0f 100755 --- a/.bin/xx.c +++ b/.bin/xx.c @@ -7,6 +7,7 @@ exec clang -Weverything -Wno-vla $@ -o $(dirname $0)/xx $0 #include #include #include +#include #include static bool zero(const uint8_t *buf, size_t len) { @@ -41,17 +42,17 @@ int main(int argc, char **argv) { flags ^= FLAG_SKIP; else { fprintf(stderr, "usage: xx [-afk] [-c N] [-g N] [FILE]\n"); - return (opt == 'h') ? EXIT_SUCCESS : EXIT_FAILURE; + return (opt == 'h') ? EX_OK : EX_USAGE; } } - if (!cols) return EXIT_FAILURE; + if (!cols) return EX_USAGE; if (argc > optind) path = argv[optind]; FILE *file = path ? fopen(path, "r") : stdin; if (!file) { perror(path); - return EXIT_FAILURE; + return EX_NOINPUT; } uint8_t buf[cols]; @@ -93,7 +94,7 @@ int main(int argc, char **argv) { if (ferror(file)) { perror(path); - return EXIT_FAILURE; + return EX_IOERR; } - return EXIT_SUCCESS; + return EX_OK; } -- cgit 1.4.1
Commit message (Expand)Author
2018-05-28eval: Fail immediately with redirections errors for simple commandHerbert Xu
2018-05-28eval: Add assignment built-in support againHerbert Xu
2018-05-28exec: Never rehash regular built-insHerbert Xu
2018-05-28exec: Stricter pathopt parsingHerbert Xu
2018-05-28builtin: Mark more regular built-insHerbert Xu
2018-05-28exec: Do not allocate stack string in padvanceHerbert Xu
2018-05-28memalloc: Add growstackto helperHerbert Xu
2018-05-28jobs: Replace some uses of fmtstr with stpcpy/stpncpyHerbert Xu
2018-05-28output: Fix fmtstr return valueHerbert Xu
2018-05-28var: Set IFS to fixed value at start timeHerbert Xu
2018-05-28parser: Save/restore here-documents in command substitutionHerbert Xu
2018-05-28jobs: Only clear gotsigchld when waiting for everythingHerbert Xu
2018-05-28mkinit: Split reset into exitreset and resetHerbert Xu
2018-05-28main: Only set savestatus in exitcmdHerbert Xu
2018-05-28exec: Return 126 on most errors in shellexecHerbert Xu
2018-05-17Release 0.5.10.2.Herbert Xu
2018-05-15parser: Fix incorrect eating of backslash newlinesHerbert Xu
2018-05-10Release 0.5.10.1.Herbert Xu
2018-05-09jobs - Do not block when waiting on SIGCHLDHerbert Xu
2018-05-03Release 0.5.10.Herbert Xu
2018-04-19eval: Variable assignments on functions are no longer persistentHerbert Xu
2018-04-19parser: Fix parameter expansion inside inner double quotesHerbert Xu
2018-04-19parser: Fix parsing of ${}Herbert Xu
2018-04-19man: correct typos, iff -> ifMartijn Dekker
2018-04-19expand: Do not quote backslashes in unquoted parameter expansionHerbert Xu
2018-04-19shell: Add subdir-objects to AM_INIT_AUTOMAKEJason Bowen
2018-04-19eval: Restore input files in evalcommandHerbert Xu
2018-04-19eval: Reap zombies after built-in commands and functionsHerbert Xu
2018-04-19redir: Fix typo in noclobber codeHerbert Xu
2018-04-19expand: Fix glibc glob(3) supportHerbert Xu
2018-04-02expand: Fix buffer overflow in expandmetaHerbert Xu
2018-04-02builtin: Move echo space/nl handling into print_escape_strHerbert Xu
2018-04-02builtin: Fix echo performance regressionHerbert Xu
2018-04-02expand: Fix ghost fields with unquoted $@/$*Herbert Xu
2018-04-02parser: Allow newlines within parameter substitutionHerbert Xu
2018-04-02expand: Fix bugs with words connected to the right of $@Herbert Xu
2018-03-25Revert "[BUILTIN] Remove unnecessary restoration of format string in printf"Herbert Xu
2018-03-22parser: Fix backquote support in here-document EOF markHerbert Xu