diff options
author | June McEnroe <june@causal.agency> | 2024-05-22 12:16:41 -0400 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2024-05-22 12:16:41 -0400 |
commit | 625662a5c1cbb71cf37653df1f31cd60c48b18ae (patch) | |
tree | 7a04a48f7007b30f086b353c0c03002c861383b9 /bin/mtags.c | |
parent | Add photo descriptions from 05-03 and 05-06 (diff) | |
download | src-625662a5c1cbb71cf37653df1f31cd60c48b18ae.tar.gz src-625662a5c1cbb71cf37653df1f31cd60c48b18ae.zip |
Remove use of sysexits.h
Diffstat (limited to 'bin/mtags.c')
-rw-r--r-- | bin/mtags.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/bin/mtags.c b/bin/mtags.c index 5c1a057e..5c42f343 100644 --- a/bin/mtags.c +++ b/bin/mtags.c @@ -21,7 +21,6 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <sysexits.h> #include <unistd.h> static void escape(FILE *file, const char *str, size_t len) { @@ -41,16 +40,16 @@ int main(int argc, char *argv[]) { switch (opt) { break; case 'a': append = true; break; case 'f': path = optarg; - break; default: return EX_USAGE; + break; default: return 1; } } FILE *tags = fopen(path, (append ? "a" : "w")); - if (!tags) err(EX_CANTCREAT, "%s", path); + if (!tags) err(1, "%s", path); #ifdef __OpenBSD__ error = pledge("stdio rpath", NULL); - if (error) err(EX_OSERR, "pledge"); + if (error) err(1, "pledge"); #endif regex_t makeFile, makeLine; @@ -87,7 +86,7 @@ int main(int argc, char *argv[]) { } FILE *file = fopen(argv[i], "r"); - if (!file) err(EX_NOINPUT, "%s", argv[i]); + if (!file) err(1, "%s", argv[i]); while (0 < getline(&buf, &cap, file)) { regmatch_t match[2]; |