[hackers] [sbase] Stop using EXIT_{SUCCESS,FAILURE} || sin
commit 0c5b7b91554823a4b2e97e23108f342d7263be34
Author: sin <sin_AT_2f30.org>
Date: Thu Oct 2 23:46:04 2014 +0100
Stop using EXIT_{SUCCESS,FAILURE}
diff --git a/basename.c b/basename.c
index f5f681c..5f6f0a3 100644
--- a/basename.c
+++ b/basename.c
_AT_@ -37,5 +37,5 @@ main(int argc, char *argv[])
puts(s);
- return EXIT_SUCCESS;
+ return 0;
}
diff --git a/cal.c b/cal.c
index a477db9..60f5741 100644
--- a/cal.c
+++ b/cal.c
_AT_@ -179,5 +179,5 @@ main(int argc, char *argv[])
drawcal(year, month, day, ncols, nmons, fday);
- return EXIT_SUCCESS;
+ return 0;
}
diff --git a/cat.c b/cat.c
index d7ac14f..a7c07c9 100644
--- a/cat.c
+++ b/cat.c
_AT_@ -39,5 +39,5 @@ main(int argc, char *argv[])
fclose(fp);
}
}
- return EXIT_SUCCESS;
+ return 0;
}
diff --git a/chmod.c b/chmod.c
index 1f28a79..b29dc0b 100644
--- a/chmod.c
+++ b/chmod.c
_AT_@ -11,7 +11,7 @@ static void chmodr(const char *);
static bool rflag = false;
static char *modestr = "";
static mode_t mask = 0;
-static int ret = EXIT_SUCCESS;
+static int ret = 0;
static void
usage(void)
_AT_@ -67,14 +67,14 @@ chmodr(const char *path)
if(stat(path, &st) == -1) {
weprintf("stat %s:", path);
- ret = EXIT_FAILURE;
+ ret = 1;
return;
}
m = parsemode(modestr, st.st_mode, mask);
if(chmod(path, m) == -1) {
weprintf("chmod %s:", path);
- ret = EXIT_FAILURE;
+ ret = 1;
}
if(rflag)
recurse(path, chmodr);
diff --git a/chown.c b/chown.c
index 1cdaed5..3fd5f87 100644
--- a/chown.c
+++ b/chown.c
_AT_@ -13,7 +13,7 @@ static void chownpwgr(const char *);
static bool rflag = false;
static struct passwd *pw = NULL;
static struct group *gr = NULL;
-static int ret = EXIT_SUCCESS;
+static int ret = 0;
static void
usage(void)
_AT_@ -76,7 +76,7 @@ chownpwgr(const char *path)
if(chown(path, pw ? pw->pw_uid : (uid_t)-1,
gr ? gr->gr_gid : (gid_t)-1) == -1) {
weprintf("chown %s:", path);
- ret = EXIT_FAILURE;
+ ret = 1;
}
if(rflag)
recurse(path, chownpwgr);
diff --git a/chroot.c b/chroot.c
index e0a1577..2fdcbea 100644
--- a/chroot.c
+++ b/chroot.c
_AT_@ -44,5 +44,5 @@ main(int argc, char *argv[])
savederrno = errno;
weprintf("execvp %s:", p);
_exit(savederrno == ENOENT ? 127 : 126);
- return EXIT_FAILURE;
+ return 1;
}
diff --git a/cksum.c b/cksum.c
index a252f93..63c0907 100644
--- a/cksum.c
+++ b/cksum.c
_AT_@ -90,7 +90,7 @@ main(int argc, char *argv[])
fclose(fp);
}
}
- return EXIT_SUCCESS;
+ return 0;
}
static void
diff --git a/col.c b/col.c
index fb3d1a6..329ce71 100644
--- a/col.c
+++ b/col.c
_AT_@ -280,7 +280,7 @@ main(int argc, char *argv[])
cur_col++;
}
if (max_line == 0)
- exit(EXIT_SUCCESS); /* no lines, so just exit */
+ exit(0); /* no lines, so just exit */
/* goto the last line that had a character on it */
for (; l->l_next; l = l->l_next)
_AT_@ -299,7 +299,7 @@ main(int argc, char *argv[])
/* missing a \n on the last line? */
nblank_lines = 2;
flush_blanks();
- exit(EXIT_SUCCESS);
+ exit(0);
}
void
diff --git a/cols.c b/cols.c
index ca37414..9e486b9 100644
--- a/cols.c
+++ b/cols.c
_AT_@ -73,7 +73,7 @@ main(int argc, char *argv[])
for(l = 0; l < b.nlines; ++l) {
fputs(b.lines[l], stdout);
}
- return EXIT_SUCCESS;
+ return 0;
}
n_rows = (b.nlines + (n_columns - 1)) / n_columns;
_AT_@ -87,5 +87,5 @@ main(int argc, char *argv[])
fputs("\n", stdout);
}
- return EXIT_SUCCESS;
+ return 0;
}
diff --git a/comm.c b/comm.c
index fe3323b..10f45b5 100644
--- a/comm.c
+++ b/comm.c
_AT_@ -63,7 +63,7 @@ main(int argc, char *argv[])
printline((2-diff) % 3, lines[MAX(0, diff)]);
}
- return EXIT_SUCCESS;
+ return 0;
}
static void
_AT_@ -101,5 +101,5 @@ finish(int pos, FILE *f, char *name)
while(nextline(buf, sizeof(buf), f, name))
printline(pos, buf);
- exit(EXIT_FAILURE);
+ exit(1);
}
diff --git a/cut.c b/cut.c
index 64081f9..5ec1d45 100644
--- a/cut.c
+++ b/cut.c
_AT_@ -192,5 +192,5 @@ main(int argc, char *argv[])
}
}
freelist();
- return EXIT_SUCCESS;
+ return 0;
}
diff --git a/date.c b/date.c
index 0c0041c..9a7d60b 100644
--- a/date.c
+++ b/date.c
_AT_@ -41,5 +41,5 @@ main(int argc, char *argv[])
strftime(buf, sizeof buf, fmt, now);
puts(buf);
- return EXIT_SUCCESS;
+ return 0;
}
diff --git a/dirname.c b/dirname.c
index 50820c6..b9c266d 100644
--- a/dirname.c
+++ b/dirname.c
_AT_@ -24,5 +24,5 @@ main(int argc, char *argv[])
puts(dirname(argv[0]));
- return EXIT_SUCCESS;
+ return 0;
}
diff --git a/du.c b/du.c
index 8382178..4e94cc5 100644
--- a/du.c
+++ b/du.c
_AT_@ -78,7 +78,7 @@ main(int argc, char *argv[])
print(n, xrealpath(argv[0], file));
}
}
- return EXIT_SUCCESS;
+ return 0;
}
static void
diff --git a/echo.c b/echo.c
index 0035e66..3aef63e 100644
--- a/echo.c
+++ b/echo.c
_AT_@ -28,5 +28,5 @@ main(int argc, char *argv[])
if(!nflag)
putchar('\n');
- return EXIT_SUCCESS;
+ return 0;
}
diff --git a/env.c b/env.c
index 70fdfb1..e336954 100644
--- a/env.c
+++ b/env.c
_AT_@ -40,5 +40,5 @@ main(int argc, char *argv[])
while(environ && *environ)
printf("%s\n", *environ++);
- return EXIT_SUCCESS;
+ return 0;
}
diff --git a/expand.c b/expand.c
index 61e67ee..2966a1d 100644
--- a/expand.c
+++ b/expand.c
_AT_@ -54,7 +54,7 @@ main(int argc, char *argv[])
fclose(fp);
}
}
- return EXIT_SUCCESS;
+ return 0;
}
static wint_t
diff --git a/false.c b/false.c
index b38b1b4..368e069 100644
--- a/false.c
+++ b/false.c
_AT_@ -4,5 +4,5 @@
int
main(void)
{
- return EXIT_FAILURE;
+ return 1;
}
diff --git a/fold.c b/fold.c
index 9f6d66a..dee3f6d 100644
--- a/fold.c
+++ b/fold.c
_AT_@ -55,7 +55,7 @@ main(int argc, char *argv[])
}
}
- return EXIT_SUCCESS;
+ return 0;
}
static void
diff --git a/head.c b/head.c
index 8313648..1f5b631 100644
--- a/head.c
+++ b/head.c
_AT_@ -44,7 +44,7 @@ main(int argc, char *argv[])
}
}
- return EXIT_SUCCESS;
+ return 0;
}
static void
diff --git a/hostname.c b/hostname.c
index 7b9177a..4b42848 100644
--- a/hostname.c
+++ b/hostname.c
_AT_@ -42,5 +42,5 @@ main(int argc, char *argv[])
free(host);
- return EXIT_SUCCESS;
+ return 0;
}
diff --git a/kill.c b/kill.c
index ea9a777..9948cb2 100644
--- a/kill.c
+++ b/kill.c
_AT_@ -74,5 +74,5 @@ main(int argc, char *argv[])
eprintf("kill %d:", pid);
}
- return EXIT_SUCCESS;
+ return 0;
}
diff --git a/ln.c b/ln.c
index ef0ff79..8869823 100644
--- a/ln.c
+++ b/ln.c
_AT_@ -52,5 +52,5 @@ main(int argc, char *argv[])
if (flink(argv[0], to) < 0)
eprintf("%s:", fname);
- return EXIT_SUCCESS;
+ return 0;
}
diff --git a/ls.c b/ls.c
index ca8f178..32c0eb7 100644
--- a/ls.c
+++ b/ls.c
_AT_@ -96,7 +96,7 @@ main(int argc, char *argv[])
for(i = 0; i < argc; i++)
ls(&ents[rflag ? argc-i-1 : i]);
- return EXIT_SUCCESS;
+ return 0;
}
static int
diff --git a/mkdir.c b/mkdir.c
index 79c8167..5762930 100644
--- a/mkdir.c
+++ b/mkdir.c
_AT_@ -50,7 +50,7 @@ main(int argc, char *argv[])
eprintf("chmod %s:", argv[0]);
}
- return EXIT_SUCCESS;
+ return 0;
}
static void
diff --git a/mkfifo.c b/mkfifo.c
index f4ccee4..7bdfcca 100644
--- a/mkfifo.c
+++ b/mkfifo.c
_AT_@ -31,5 +31,5 @@ main(int argc, char *argv[])
for(; argc > 0; argc--, argv++)
if(mkfifo(argv[0], mode) == -1)
eprintf("mkfifo %s:", argv[0]);
- return EXIT_SUCCESS;
+ return 0;
}
diff --git a/mktemp.c b/mktemp.c
index 697d789..5e890c0 100644
--- a/mktemp.c
+++ b/mktemp.c
_AT_@ -62,16 +62,16 @@ main(int argc, char *argv[])
if (!mkdtemp(path)) {
if (!qflag)
eprintf("mkdtemp %s:", path);
- exit(EXIT_FAILURE);
+ exit(1);
}
} else {
if ((fd = mkstemp(path)) < 0) {
if (!qflag)
eprintf("mkstemp %s:", path);
- exit(EXIT_FAILURE);
+ exit(1);
}
close(fd);
}
puts(path);
- return EXIT_SUCCESS;
+ return 0;
}
diff --git a/mv.c b/mv.c
index acf5e39..e8be12d 100644
--- a/mv.c
+++ b/mv.c
_AT_@ -34,7 +34,7 @@ main(int argc, char *argv[])
eprintf("%s: not a directory\n", argv[argc-1]);
enmasse(argc, &argv[0], mv);
- return EXIT_SUCCESS;
+ return 0;
}
static int
diff --git a/nl.c b/nl.c
index 2d15391..5a5bc1f 100644
--- a/nl.c
+++ b/nl.c
_AT_@ -58,7 +58,7 @@ main(int argc, char *argv[])
fclose(fp);
}
- return EXIT_SUCCESS;
+ return 0;
}
void
diff --git a/paste.c b/paste.c
index 7ec129a..fe07a31 100644
--- a/paste.c
+++ b/paste.c
_AT_@ -96,7 +96,7 @@ main(int argc, char *argv[])
free(delim);
free(dsc);
- return EXIT_SUCCESS;
+ return 0;
}
static size_t
diff --git a/printenv.c b/printenv.c
index 085f3ea..fb49d92 100644
--- a/printenv.c
+++ b/printenv.c
_AT_@ -25,12 +25,12 @@ main(int argc, char *argv[])
while(*environ)
printf("%s\n", *environ++);
- return EXIT_SUCCESS;
+ return 0;
}
while(*++argv) {
if((var = getenv(*argv)))
printf("%s\n", var);
}
- return EXIT_SUCCESS;
+ return 0;
}
diff --git a/pwd.c b/pwd.c
index d3a6955..ab2ea7d 100644
--- a/pwd.c
+++ b/pwd.c
_AT_@ -31,7 +31,7 @@ main(int argc, char *argv[])
cwd = agetcwd();
puts((mode == 'L') ? getpwd(cwd) : cwd);
- return EXIT_SUCCESS;
+ return 0;
}
static const char *
diff --git a/readlink.c b/readlink.c
index 92e2428..1d0b4a3 100644
--- a/readlink.c
+++ b/readlink.c
_AT_@ -40,7 +40,7 @@ main(int argc, char *argv[])
usage();
if (strlen(argv[0]) > PATH_MAX - 1)
- return EXIT_FAILURE;
+ return 1;
if (fflag) {
if (realpath(argv[0], buf) == NULL)
_AT_@ -55,5 +55,5 @@ main(int argc, char *argv[])
if (!nflag)
putchar('\n');
- return EXIT_SUCCESS;
+ return 0;
}
diff --git a/renice.c b/renice.c
index 8249039..9d44263 100644
--- a/renice.c
+++ b/renice.c
_AT_@ -23,7 +23,7 @@ main(int argc, char *argv[])
{
const char *adj = NULL;
long val;
- int i, which = PRIO_PROCESS, status = EXIT_SUCCESS;
+ int i, which = PRIO_PROCESS, status = 0;
ARGBEGIN {
case 'n':
_AT_@ -60,7 +60,7 @@ main(int argc, char *argv[])
who = pwd->pw_uid;
else if(errno != 0) {
perror("can't read passwd");
- status = EXIT_FAILURE;
+ status = 1;
continue;
}
}
_AT_@ -68,7 +68,7 @@ main(int argc, char *argv[])
who = strtop(argv[i]);
if(who < 0 || !renice(which, who, val))
- status = EXIT_FAILURE;
+ status = 1;
}
return status;
diff --git a/rm.c b/rm.c
index eda84c2..4b52fb4 100644
--- a/rm.c
+++ b/rm.c
_AT_@ -32,11 +32,11 @@ main(int argc, char *argv[])
if (rm_fflag == false)
usage();
else
- return EXIT_SUCCESS;
+ return 0;
}
for(; argc > 0; argc--, argv++)
rm(argv[0]);
- return EXIT_SUCCESS;
+ return 0;
}
diff --git a/rmdir.c b/rmdir.c
index ec0110c..f53caf0 100644
--- a/rmdir.c
+++ b/rmdir.c
_AT_@ -28,5 +28,5 @@ main(int argc, char *argv[])
fprintf(stderr, "rmdir: '%s': %s\n",
argv[0], strerror(errno));
- return EXIT_SUCCESS;
+ return 0;
}
diff --git a/seq.c b/seq.c
index 9beb568..2f92e49 100644
--- a/seq.c
+++ b/seq.c
_AT_@ -63,7 +63,7 @@ main(int argc, char *argv[])
dir = (step > 0) ? 1.0 : -1.0;
if(step == 0 || start * dir > end * dir)
- return EXIT_FAILURE;
+ return 1;
if(fmt == ftmp) {
right = MAX(digitsright(starts),
_AT_@ -85,7 +85,7 @@ main(int argc, char *argv[])
}
printf("\n");
- return EXIT_SUCCESS;
+ return 0;
}
static int
diff --git a/setsid.c b/setsid.c
index b46c4f3..e1183a9 100644
--- a/setsid.c
+++ b/setsid.c
_AT_@ -32,7 +32,7 @@ main(int argc, char *argv[])
case 0:
break;
default:
- return EXIT_SUCCESS;
+ return 0;
}
}
if(setsid() < 0)
diff --git a/sleep.c b/sleep.c
index 4cbbed9..ffeec40 100644
--- a/sleep.c
+++ b/sleep.c
_AT_@ -25,5 +25,5 @@ main(int argc, char *argv[])
seconds = estrtol(argv[0], 0);
while((seconds = sleep(seconds)) > 0)
;
- return EXIT_SUCCESS;
+ return 0;
}
diff --git a/sort.c b/sort.c
index e97673b..381331d 100644
--- a/sort.c
+++ b/sort.c
_AT_@ -107,7 +107,7 @@ main(int argc, char *argv[])
}
freelist();
- return EXIT_SUCCESS;
+ return 0;
}
static void
diff --git a/split.c b/split.c
index 4b2c2d8..9dddf0a 100644
--- a/split.c
+++ b/split.c
_AT_@ -105,7 +105,7 @@ Nextfile:
fclose(out);
break;
}
- return EXIT_SUCCESS;
+ return 0;
}
int
diff --git a/sponge.c b/sponge.c
index 8961339..ab4dda2 100644
--- a/sponge.c
+++ b/sponge.c
_AT_@ -36,5 +36,5 @@ main(int argc, char *argv[])
fclose(fp);
fclose(tmpfp);
- return EXIT_SUCCESS;
+ return 0;
}
diff --git a/strings.c b/strings.c
index 01feb66..e436ec5 100644
--- a/strings.c
+++ b/strings.c
_AT_@ -35,7 +35,7 @@ main(int argc, char *argv[])
}
}
- return EXIT_SUCCESS;
+ return 0;
}
static void
diff --git a/sync.c b/sync.c
index a158041..ada5464 100644
--- a/sync.c
+++ b/sync.c
_AT_@ -17,5 +17,5 @@ main(int argc, char *argv[])
usage();
sync();
- return EXIT_SUCCESS;
+ return 0;
}
diff --git a/tail.c b/tail.c
index 87a08b9..854fca0 100644
--- a/tail.c
+++ b/tail.c
_AT_@ -49,7 +49,7 @@ main(int argc, char *argv[])
}
}
- return EXIT_SUCCESS;
+ return 0;
}
static void
diff --git a/tar.c b/tar.c
index 4f31965..4f4abff 100644
--- a/tar.c
+++ b/tar.c
_AT_@ -138,7 +138,7 @@ main(int argc, char *argv[])
xt((mode == 'x') ? unarchive : print);
}
- return EXIT_SUCCESS;
+ return 0;
}
static void
diff --git a/tee.c b/tee.c
index d88e49c..e810587 100644
--- a/tee.c
+++ b/tee.c
_AT_@ -47,5 +47,5 @@ main(int argc, char *argv[])
eprintf("<stdin>: read error:");
free(fps);
- return EXIT_SUCCESS;
+ return 0;
}
diff --git a/test.c b/test.c
index ff028bd..2284ab0 100644
--- a/test.c
+++ b/test.c
_AT_@ -52,7 +52,7 @@ main(int argc, char *argv[])
}
if(not)
ret = !ret;
- return ret ? EXIT_SUCCESS : EXIT_FAILURE;
+ return ret ? 0 : 1;
}
static bool
diff --git a/touch.c b/touch.c
index ce09cf7..80462df 100644
--- a/touch.c
+++ b/touch.c
_AT_@ -42,7 +42,7 @@ main(int argc, char *argv[])
for(; argc > 0; argc--, argv++)
touch(argv[0]);
- return EXIT_SUCCESS;
+ return 0;
}
static void
diff --git a/tr.c b/tr.c
index e75fcea..1fe68e8 100644
--- a/tr.c
+++ b/tr.c
_AT_@ -352,5 +352,5 @@ main(int argc, char *argv[])
if(ferror(stdin))
eprintf("<stdin>: read error:");
- return EXIT_SUCCESS;
+ return 0;
}
diff --git a/true.c b/true.c
index 8737dd5..aa92e0b 100644
--- a/true.c
+++ b/true.c
_AT_@ -4,5 +4,5 @@
int
main(void)
{
- return EXIT_SUCCESS;
+ return 0;
}
diff --git a/tty.c b/tty.c
index a9d64bd..6bb77ae 100644
--- a/tty.c
+++ b/tty.c
_AT_@ -22,5 +22,5 @@ main(int argc, char *argv[])
tty = ttyname(STDIN_FILENO);
puts(tty ? tty : "not a tty");
- return tty ? EXIT_SUCCESS : EXIT_FAILURE;
+ return tty ? 0 : 1;
}
diff --git a/uname.c b/uname.c
index 9314a8d..b7900c9 100644
--- a/uname.c
+++ b/uname.c
_AT_@ -59,5 +59,5 @@ main(int argc, char *argv[])
putword(u.machine);
putchar('\n');
- return EXIT_SUCCESS;
+ return 0;
}
diff --git a/unexpand.c b/unexpand.c
index 5416803..cc185f2 100644
--- a/unexpand.c
+++ b/unexpand.c
_AT_@ -57,7 +57,7 @@ main(int argc, char *argv[])
}
}
- return EXIT_SUCCESS;
+ return 0;
}
static wint_t
diff --git a/uniq.c b/uniq.c
index 03fe72d..4057ad2 100644
--- a/uniq.c
+++ b/uniq.c
_AT_@ -57,7 +57,7 @@ main(int argc, char *argv[])
usage();
uniqfinish();
- return EXIT_SUCCESS;
+ return 0;
}
static void
diff --git a/unlink.c b/unlink.c
index 5b74d90..ac04632 100644
--- a/unlink.c
+++ b/unlink.c
_AT_@ -18,5 +18,5 @@ main(int argc, char *argv[])
if(unlink(argv[1]) == -1)
eprintf("unlink: '%s':", argv[1]);
- return EXIT_SUCCESS;
+ return 0;
}
diff --git a/util/cp.c b/util/cp.c
index 030dfab..860c324 100644
--- a/util/cp.c
+++ b/util/cp.c
_AT_@ -22,7 +22,7 @@ bool cp_fflag = false;
bool cp_pflag = false;
bool cp_rflag = false;
bool cp_vflag = false;
-int cp_status = EXIT_SUCCESS;
+int cp_status = 0;
int
cp(const char *s1, const char *s2)
_AT_@ -52,7 +52,7 @@ cp(const char *s1, const char *s2)
unlink(s2);
if(symlink(buf, s2) != 0) {
weprintf("%s: can't create '%s'\n", argv0, s2);
- cp_status = EXIT_FAILURE;
+ cp_status = 1;
return 0;
}
}
_AT_@ -98,7 +98,7 @@ cp(const char *s1, const char *s2)
unlink(s2);
if(mknod(s2, st.st_mode, st.st_rdev) < 0) {
weprintf("%s: can't create '%s':", argv0, s2);
- cp_status = EXIT_FAILURE;
+ cp_status = 1;
return 0;
}
goto preserve;
_AT_@ -107,7 +107,7 @@ cp(const char *s1, const char *s2)
if(!(f1 = fopen(s1, "r"))) {
weprintf("fopen %s:", s1);
- cp_status = EXIT_FAILURE;
+ cp_status = 1;
return 0;
}
_AT_@ -116,12 +116,12 @@ cp(const char *s1, const char *s2)
unlink(s2);
if(!(f2 = fopen(s2, "w"))) {
weprintf("fopen %s:", s2);
- cp_status = EXIT_FAILURE;
+ cp_status = 1;
return 0;
}
} else {
weprintf("fopen %s:", s2);
- cp_status = EXIT_FAILURE;
+ cp_status = 1;
return 0;
}
}
_AT_@ -145,7 +145,7 @@ preserve:
r = chown(s2, st.st_uid, st.st_gid);
if(r == -1) {
weprintf("cp: can't preserve ownership of '%s':", s2);
- cp_status = EXIT_FAILURE;
+ cp_status = 1;
}
}
return 0;
diff --git a/util/crypt.c b/util/crypt.c
index cd9ff32..19b4d0e 100644
--- a/util/crypt.c
+++ b/util/crypt.c
_AT_@ -42,7 +42,7 @@ cryptcheck(char *sumfile, int argc, char *argv[],
{
FILE *cfp, *fp;
char *line = NULL, *file, *p;
- int r, nonmatch = 0, formatsucks = 0, noread = 0, ret = EXIT_SUCCESS;
+ int r, nonmatch = 0, formatsucks = 0, noread = 0, ret = 0;
size_t bufsiz = 0;
if(sumfile == NULL)
_AT_@ -85,15 +85,15 @@ cryptcheck(char *sumfile, int argc, char *argv[],
free(line);
if(formatsucks > 0) {
weprintf("%d lines are improperly formatted\n", formatsucks);
- ret = EXIT_FAILURE;
+ ret = 1;
}
if(noread > 0) {
weprintf("%d listed file could not be read\n", noread);
- ret = EXIT_FAILURE;
+ ret = 1;
}
if(nonmatch > 0) {
weprintf("%d computed checksums did NOT match\n", nonmatch);
- ret = EXIT_FAILURE;
+ ret = 1;
}
return ret;
}
_AT_@ -103,7 +103,7 @@ cryptmain(int argc, char *argv[],
struct crypt_ops *ops, uint8_t *md, size_t sz)
{
FILE *fp;
- int ret = EXIT_SUCCESS;
+ int ret = 0;
if (argc == 0) {
cryptsum(ops, stdin, "<stdin>", md);
_AT_@ -112,11 +112,11 @@ cryptmain(int argc, char *argv[],
for (; argc > 0; argc--) {
if((fp = fopen(*argv, "r")) == NULL) {
weprintf("fopen %s:", *argv);
- ret = EXIT_FAILURE;
+ ret = 1;
continue;
}
if(cryptsum(ops, fp, *argv, md) == 1)
- ret = EXIT_FAILURE;
+ ret = 1;
else
mdprint(md, *argv, sz);
fclose(fp);
diff --git a/util/eprintf.c b/util/eprintf.c
index 91b19b7..5b7fb25 100644
--- a/util/eprintf.c
+++ b/util/eprintf.c
_AT_@ -16,7 +16,7 @@ eprintf(const char *fmt, ...)
va_list ap;
va_start(ap, fmt);
- venprintf(EXIT_FAILURE, fmt, ap);
+ venprintf(1, fmt, ap);
va_end(ap);
}
diff --git a/uudecode.c b/uudecode.c
index b17a0f1..f0af13d 100644
--- a/uudecode.c
+++ b/uudecode.c
_AT_@ -58,7 +58,7 @@ main(int argc, char *argv[])
if (nfp)
fclose(nfp);
- return EXIT_SUCCESS;
+ return 0;
}
static FILE *
diff --git a/uuencode.c b/uuencode.c
index 1aca541..c74b46d 100644
--- a/uuencode.c
+++ b/uuencode.c
_AT_@ -37,7 +37,7 @@ main(int argc, char *argv[])
uuencode(fp, argv[1], argv[0]);
fclose(fp);
}
- return EXIT_SUCCESS;
+ return 0;
}
static void
diff --git a/wc.c b/wc.c
index cd0bf46..99bccce 100644
--- a/wc.c
+++ b/wc.c
_AT_@ -57,7 +57,7 @@ main(int argc, char *argv[])
if (argc > 1)
output("total", tc, tl, tw);
}
- return EXIT_SUCCESS;
+ return 0;
}
void
diff --git a/yes.c b/yes.c
index 3678263..c52a544 100644
--- a/yes.c
+++ b/yes.c
_AT_@ -19,5 +19,5 @@ main(int argc, char *argv[])
for (;;)
puts(argc >= 1 ? argv[0] : "y");
- return EXIT_FAILURE; /* should not reach */
+ return 1; /* should not reach */
}
Received on Fri Oct 03 2014 - 00:47:31 CEST
This archive was generated by hypermail 2.3.0
: Fri Oct 03 2014 - 00:48:08 CEST