diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2015-01-23 02:37:26 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2015-01-23 02:37:26 +0000 |
commit | 5b1572f4cc85114d8b27bc3e94416d805171937f (patch) | |
tree | cb629f6047d32c05cea7f2e7aa30e71de4194caa /usr.sbin/cron/user.c | |
parent | 6e108fa118245a27c3c49d2a68b390c56d6869e2 (diff) |
Remove the OK and ERR macros. They obfuscate the code and don't
help legibility. (unix system calls use 0 for ok, but hundreds of
other projects use 1 to indicate success.) Despite the name, many
system calls (e.g., open) also return not OK values for success.
It also cleans up some weird code like int crontab_fd = OK - 1;
This diff is mechanical in nature. Later I will fix the bugs it reveals.
ok deraadt
Diffstat (limited to 'usr.sbin/cron/user.c')
-rw-r--r-- | usr.sbin/cron/user.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/cron/user.c b/usr.sbin/cron/user.c index e73093414dd..96995a89aac 100644 --- a/usr.sbin/cron/user.c +++ b/usr.sbin/cron/user.c @@ -1,4 +1,4 @@ -/* $OpenBSD: user.c,v 1.10 2015/01/23 01:01:06 tedu Exp $ */ +/* $OpenBSD: user.c,v 1.11 2015/01/23 02:37:25 tedu Exp $ */ /* Copyright 1988,1990,1993,1994 by Paul Vixie * All rights reserved @@ -76,9 +76,9 @@ load_user(int crontab_fd, struct passwd *pw, const char *name) { /* load the crontab */ - while ((status = load_env(envstr, file)) >= OK) { + while ((status = load_env(envstr, file)) >= 0) { switch (status) { - case ERR: + case -1: free_user(u); u = NULL; goto done; |