diff options
author | Xavier Santolaria <xsa@cvs.openbsd.org> | 2005-04-03 17:32:51 +0000 |
---|---|---|
committer | Xavier Santolaria <xsa@cvs.openbsd.org> | 2005-04-03 17:32:51 +0000 |
commit | 5084bac86a0c29797507aafc3a1f283df9a435e8 (patch) | |
tree | 14a72622e2e38c0d13ad93871a7f519329b15823 /usr.bin/cvs | |
parent | 3edfba4e92c860e5173084d804678f462b212ef9 (diff) |
first round of EX_* exit codes removal; ok joris@.
Diffstat (limited to 'usr.bin/cvs')
-rw-r--r-- | usr.bin/cvs/add.c | 6 | ||||
-rw-r--r-- | usr.bin/cvs/admin.c | 48 | ||||
-rw-r--r-- | usr.bin/cvs/annotate.c | 8 | ||||
-rw-r--r-- | usr.bin/cvs/checkout.c | 10 | ||||
-rw-r--r-- | usr.bin/cvs/child.c | 6 | ||||
-rw-r--r-- | usr.bin/cvs/cmd.c | 22 | ||||
-rw-r--r-- | usr.bin/cvs/commit.c | 8 | ||||
-rw-r--r-- | usr.bin/cvs/cvs.c | 6 | ||||
-rw-r--r-- | usr.bin/cvs/cvsd.c | 18 | ||||
-rw-r--r-- | usr.bin/cvs/diff.c | 4 | ||||
-rw-r--r-- | usr.bin/cvs/history.c | 12 | ||||
-rw-r--r-- | usr.bin/cvs/import.c | 6 | ||||
-rw-r--r-- | usr.bin/cvs/init.c | 11 | ||||
-rw-r--r-- | usr.bin/cvs/proto.c | 5 | ||||
-rw-r--r-- | usr.bin/cvs/server.c | 6 | ||||
-rw-r--r-- | usr.bin/cvs/status.c | 4 | ||||
-rw-r--r-- | usr.bin/cvs/tag.c | 12 | ||||
-rw-r--r-- | usr.bin/cvs/version.c | 3 |
18 files changed, 96 insertions, 99 deletions
diff --git a/usr.bin/cvs/add.c b/usr.bin/cvs/add.c index 869c7389258..eee2dd4f5f3 100644 --- a/usr.bin/cvs/add.c +++ b/usr.bin/cvs/add.c @@ -1,4 +1,4 @@ -/* $OpenBSD: add.c,v 1.15 2005/03/30 17:43:04 joris Exp $ */ +/* $OpenBSD: add.c,v 1.16 2005/04/03 17:32:50 xsa Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -80,7 +80,7 @@ cvs_add_options(char *opt, int argc, char **argv, int *arg) case 'm': if ((cvs_msg = strdup(optarg)) == NULL) { cvs_log(LP_ERRNO, "failed to copy message"); - return (EX_DATAERR); + return (-1); } break; default: @@ -101,7 +101,7 @@ cvs_add_sendflags(struct cvsroot *root) strlcpy(buf, "-k", sizeof(buf)); strlcat(buf, koptstr, sizeof(buf)); if (cvs_sendarg(root, buf, 0) < 0) - return (EX_PROTOCOL); + return (-1); } return (0); diff --git a/usr.bin/cvs/admin.c b/usr.bin/cvs/admin.c index fa7dd9ce56e..b7e5a415952 100644 --- a/usr.bin/cvs/admin.c +++ b/usr.bin/cvs/admin.c @@ -1,4 +1,4 @@ -/* $OpenBSD: admin.c,v 1.7 2005/03/30 17:43:04 joris Exp $ */ +/* $OpenBSD: admin.c,v 1.8 2005/04/03 17:32:50 xsa Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * Copyright (c) 2005 Joris Vink <joris@openbsd.org> @@ -161,7 +161,7 @@ cvs_admin_options(char *opt, int argc, char **argv, int *arg) /* do some sanity checking on the arguments */ if ((strictlock & LOCK_SET) && (strictlock & LOCK_REMOVE)) { cvs_log(LP_ERR, "-L and -U are incompatible"); - return (EX_PROTOCOL); + return (-1); } if (lockrev_arg != NULL) { @@ -177,7 +177,7 @@ cvs_admin_options(char *opt, int argc, char **argv, int *arg) if ((rcs = rcsnum_parse(unlockrev_arg)) == NULL) { cvs_log(LP_ERR, "%s is not a numeric branch", unlockrev_arg); - return (EX_PROTOCOL); + return (-1); } rcsnum_free(rcs); } @@ -191,7 +191,7 @@ cvs_admin_options(char *opt, int argc, char **argv, int *arg) if ((rcs = rcsnum_parse(replace_msg)) == NULL) { cvs_log(LP_ERR, "%s is not a numeric revision", replace_msg); - return (EX_PROTOCOL); + return (-1); } rcsnum_free(rcs); *q = ':'; @@ -206,84 +206,84 @@ cvs_admin_sendflags(struct cvsroot *root) { if ((alist != NULL) && ((cvs_sendarg(root, "-a", 0) < 0) || (cvs_sendarg(root, alist, 0) < 0))) - return (EX_PROTOCOL); + return (-1); if ((userfile != NULL) && ((cvs_sendarg(root, "-A", 0) < 0) || (cvs_sendarg(root, userfile, 0) < 0))) - return (EX_PROTOCOL); + return (-1); if (runflags & FLAG_BRANCH) { if (cvs_sendarg(root, "-b", 0) < 0) - return (EX_PROTOCOL); + return (-1); if ((branch_arg != NULL) && (cvs_sendarg(root, branch_arg, 0) < 0)) - return (EX_PROTOCOL); + return (-1); } if ((comment != NULL) && ((cvs_sendarg(root, "-c", 0) < 0) || (cvs_sendarg(root, comment, 0) < 0))) - return (EX_PROTOCOL); + return (-1); if (runflags & FLAG_DELUSER) { if (cvs_sendarg(root, "-e", 0) < 0) - return (EX_PROTOCOL); + return (-1); if ((elist != NULL) && (cvs_sendarg(root, elist, 0) < 0)) - return (EX_PROTOCOL); + return (-1); } if (runflags & FLAG_INTERACTIVE) { if (cvs_sendarg(root, "-I", 0) < 0) - return (EX_PROTOCOL); + return (-1); } if ((subst != NULL) && ((cvs_sendarg(root, "-k", 0) < 0) || (cvs_sendarg(root, subst, 0) < 0))) - return (EX_PROTOCOL); + return (-1); if (lockrev & LOCK_SET) { if (cvs_sendarg(root, "-l", 0) < 0) - return (EX_PROTOCOL); + return (-1); if ((lockrev_arg != NULL) && (cvs_sendarg(root, lockrev_arg, 0) < 0)) - return (0); + return (-1); } if ((strictlock & LOCK_SET) && (cvs_sendarg(root, "-L", 0) < 0)) - return (EX_PROTOCOL); + return (-1); if ((replace_msg != NULL) && ((cvs_sendarg(root, "-m", 0) < 0) || (cvs_sendarg(root, replace_msg, 0) < 0))) - return (EX_PROTOCOL); + return (-1); if ((ntag != NULL) && ((cvs_sendarg(root, "-n", 0) < 0) || (cvs_sendarg(root, ntag, 0) < 0))) - return (EX_PROTOCOL); + return (-1); if ((Ntag != NULL) && ((cvs_sendarg(root, "-N", 0) < 0) || (cvs_sendarg(root, Ntag, 0) < 0))) - return (EX_PROTOCOL); + return (-1); if ((range != NULL) && ((cvs_sendarg(root, "-o", 0) < 0) || (cvs_sendarg(root, range, 0) < 0))) - return (EX_PROTOCOL); + return (-1); if ((state != NULL) && ((cvs_sendarg(root, "-s", 0) < 0) || (cvs_sendarg(root, state, 0) < 0))) - return (EX_PROTOCOL); + return (-1); if (lockrev & LOCK_REMOVE) { if (cvs_sendarg(root, "-u", 0) < 0) - return (EX_PROTOCOL); + return (-1); if ((unlockrev_arg != NULL) && (cvs_sendarg(root, unlockrev_arg, 0) < 0)) - return (EX_PROTOCOL); + return (-1); } if ((strictlock & LOCK_REMOVE) && (cvs_sendarg(root, "-U", 0) < 0)) - return (EX_PROTOCOL); + return (-1); return (0); } diff --git a/usr.bin/cvs/annotate.c b/usr.bin/cvs/annotate.c index 37b3caeef37..499317090b7 100644 --- a/usr.bin/cvs/annotate.c +++ b/usr.bin/cvs/annotate.c @@ -1,4 +1,4 @@ -/* $OpenBSD: annotate.c,v 1.5 2005/03/30 17:43:04 joris Exp $ */ +/* $OpenBSD: annotate.c,v 1.6 2005/04/03 17:32:50 xsa Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -104,18 +104,18 @@ int cvs_annotate_sendflags(struct cvsroot *root) { if (usehead && (cvs_sendarg(root, "-f", 0) < 0)) - return (EX_PROTOCOL); + return (-1); if (rev != NULL) { if ((cvs_sendarg(root, "-r", 0) < 0) || (cvs_sendarg(root, rev, 0) < 0)) - return (EX_PROTOCOL); + return (-1); } if (date != NULL) { if ((cvs_sendarg(root, "-D", 0) < 0) || (cvs_sendarg(root, date, 0) < 0)) - return (EX_PROTOCOL); + return (-1); } return (0); diff --git a/usr.bin/cvs/checkout.c b/usr.bin/cvs/checkout.c index 47f1e74272b..d29c66387fa 100644 --- a/usr.bin/cvs/checkout.c +++ b/usr.bin/cvs/checkout.c @@ -1,4 +1,4 @@ -/* $OpenBSD: checkout.c,v 1.14 2005/03/30 17:43:04 joris Exp $ */ +/* $OpenBSD: checkout.c,v 1.15 2005/04/03 17:32:50 xsa Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -129,21 +129,21 @@ int cvs_checkout_sendflags(struct cvsroot *root) { if (cvs_senddir(root, cvs_files) < 0) - return (EX_PROTOCOL); + return (-1); if (cvs_sendreq(root, CVS_REQ_XPANDMOD, NULL) < 0) cvs_log(LP_ERR, "failed to expand module"); /* XXX not too sure why we have to send this arg */ if (cvs_sendarg(root, "-N", 0) < 0) - return (EX_PROTOCOL); + return (-1); if ((statmod == CVS_LISTMOD) && (cvs_sendarg(root, "-c", 0) < 0)) - return (EX_PROTOCOL); + return (-1); if ((statmod == CVS_STATMOD) && (cvs_sendarg(root, "-s", 0) < 0)) - return (EX_PROTOCOL); + return (-1); return (0); } diff --git a/usr.bin/cvs/child.c b/usr.bin/cvs/child.c index 5a4a9b7d005..18a4208a4f5 100644 --- a/usr.bin/cvs/child.c +++ b/usr.bin/cvs/child.c @@ -1,4 +1,4 @@ -/* $OpenBSD: child.c,v 1.2 2005/02/22 22:36:09 jfb Exp $ */ +/* $OpenBSD: child.c,v 1.3 2005/04/03 17:32:50 xsa Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -130,7 +130,7 @@ main(int argc, char **argv) cvsd_sess_fd = CVSD_CHILD_SOCKFD; if (getpeereid(cvsd_sess_fd, &cvsd_sess_ruid, &cvsd_sess_rgid) == -1) { cvs_log(LP_ERRNO, "failed to get remote credentials"); - exit(EX_OSERR); + exit(1); } while ((ret = getopt(argc, argv, "dfg:hr:u:v")) != -1) { @@ -176,7 +176,7 @@ main(int argc, char **argv) */ if (chroot(cvsd_root) == -1) { cvs_log(LP_ERRNO, "failed to chroot to %s", cvsd_root); - exit(EX_OSERR); + exit(1); } (void)chdir("/"); cvs_log(LP_INFO, "dropping privileges to %d:%d", cvsd_uid, cvsd_gid); diff --git a/usr.bin/cvs/cmd.c b/usr.bin/cvs/cmd.c index ccbd423d863..84e1e385d99 100644 --- a/usr.bin/cvs/cmd.c +++ b/usr.bin/cvs/cmd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd.c,v 1.6 2005/04/01 09:44:00 joris Exp $ */ +/* $OpenBSD: cmd.c,v 1.7 2005/04/03 17:32:50 xsa Exp $ */ /* * Copyright (c) 2005 Joris Vink <joris@openbsd.org> * All rights reserved. @@ -60,7 +60,7 @@ cvs_startcmd(struct cvs_cmd *cmd, int argc, char **argv) } if (c->cmd_options != NULL) { - if ((ret = c->cmd_options(cmd->cmd_opts, argc, argv, &i))) + if ((ret = c->cmd_options(cmd->cmd_opts, argc, argv, &i)) < 0) return (ret); argc -= i; @@ -73,9 +73,9 @@ cvs_startcmd(struct cvs_cmd *cmd, int argc, char **argv) cvs_files = cvs_file_get(".", c->file_flags); if (cvs_files == NULL) - return (EX_DATAERR); + return (-1); - if ((c->cmd_helper != NULL) && ((ret = c->cmd_helper()))) + if ((c->cmd_helper != NULL) && ((ret = c->cmd_helper()) < 0)) return (ret); root = CVS_DIR_ROOT(cvs_files); @@ -89,23 +89,23 @@ cvs_startcmd(struct cvs_cmd *cmd, int argc, char **argv) if (root->cr_method != CVS_METHOD_LOCAL) { if (cvs_connect(root) < 0) - return (EX_PROTOCOL); + return (-1); if (c->cmd_flags & CVS_CMD_SENDARGS1) { for (i = 0; i < argc; i++) { if (cvs_sendarg(root, argv[i], 0) < 0) - return (EX_PROTOCOL); + return (-1); } } if (c->cmd_sendflags != NULL) { - if ((ret = c->cmd_sendflags(root))) + if ((ret = c->cmd_sendflags(root)) < 0) return (ret); } if (c->cmd_flags & CVS_CMD_NEEDLOG) { if (cvs_logmsg_send(root, cvs_msg) < 0) - return (EX_PROTOCOL); + return (-1); } } @@ -121,19 +121,19 @@ cvs_startcmd(struct cvs_cmd *cmd, int argc, char **argv) if (root->cr_method != CVS_METHOD_LOCAL) { if (c->cmd_flags & CVS_CMD_SENDDIR) { if (cvs_senddir(root, cvs_files) < 0) - return (EX_PROTOCOL); + return (-1); } if (c->cmd_flags & CVS_CMD_SENDARGS2) { for (i = 0; i < argc; i++) { if (cvs_sendarg(root, argv[i], 0) < 0) - return (EX_PROTOCOL); + return (-1); } } if (cvs_sendreq(root, c->cmd_req, (cmd->cmd_op == CVS_OP_INIT) ? root->cr_dir : NULL) < 0) - return (EX_PROTOCOL); + return (-1); } return (0); diff --git a/usr.bin/cvs/commit.c b/usr.bin/cvs/commit.c index ad9f788ce6f..b9b5ba5434b 100644 --- a/usr.bin/cvs/commit.c +++ b/usr.bin/cvs/commit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: commit.c,v 1.19 2005/03/31 15:10:51 joris Exp $ */ +/* $OpenBSD: commit.c,v 1.20 2005/04/03 17:32:50 xsa Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -81,7 +81,7 @@ cvs_commit_options(char *opt, int argc, char **argv, int *arg) cvs_msg = strdup(optarg); if (cvs_msg == NULL) { cvs_log(LP_ERRNO, "failed to copy message"); - return (EX_DATAERR); + return (-1); } break; case 'R': @@ -98,7 +98,7 @@ cvs_commit_options(char *opt, int argc, char **argv, int *arg) } if ((mfile != NULL) && (cvs_msg = cvs_logmsg_open(mfile)) == NULL) - return (EX_DATAERR); + return (-1); *arg = optind; return (0); @@ -126,7 +126,7 @@ cvs_commit_helper(void) } if (cvs_msg == NULL) - return (1); + return (-1); return (0); } diff --git a/usr.bin/cvs/cvs.c b/usr.bin/cvs/cvs.c index dfda9e452ab..ea100bd6d1c 100644 --- a/usr.bin/cvs/cvs.c +++ b/usr.bin/cvs/cvs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cvs.c,v 1.46 2005/03/31 17:18:24 joris Exp $ */ +/* $OpenBSD: cvs.c,v 1.47 2005/04/03 17:32:50 xsa Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -369,7 +369,7 @@ main(int argc, char **argv) cvs_log(LP_ERR, "failed to load default arguments to %s", __progname); - exit(EX_OSERR); + exit(1); } cvs_getopt(i, targv); @@ -416,7 +416,7 @@ main(int argc, char **argv) if (ret < 0) { cvs_log(LP_ERRNO, "failed to generate argument vector " "from default arguments"); - exit(EX_DATAERR); + exit(1); } cmd_argc += ret; } diff --git a/usr.bin/cvs/cvsd.c b/usr.bin/cvs/cvsd.c index 487c47400c7..9f47f2e5d04 100644 --- a/usr.bin/cvs/cvsd.c +++ b/usr.bin/cvs/cvsd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cvsd.c,v 1.18 2005/02/22 22:33:01 jfb Exp $ */ +/* $OpenBSD: cvsd.c,v 1.19 2005/04/03 17:32:50 xsa Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -210,11 +210,11 @@ main(int argc, char **argv) pwd = getpwnam(cvsd_user); if (pwd == NULL) - err(EX_NOUSER, "failed to get user `%s'", cvsd_user); + err(1, "failed to get user `%s'", cvsd_user); grp = getgrnam(cvsd_group); if (grp == NULL) - err(EX_NOUSER, "failed to get group `%s'", cvsd_group); + err(1, "failed to get group `%s'", cvsd_group); endpwent(); endgrent(); @@ -231,12 +231,12 @@ main(int argc, char **argv) if (!cvsd_fg && daemon(0, 0) == -1) { cvs_log(LP_ERRNO, "failed to become a daemon"); - exit(EX_OSERR); + exit(1); } if ((cvsd_repo = cvs_repo_load(cvsd_root, repo_flags)) == NULL) { cvs_log(LP_ERR, "failed to load repository"); - exit(EX_OSERR); + exit(1); }; if (cvsd_sock_open() < 0) { @@ -245,11 +245,11 @@ main(int argc, char **argv) if (setegid(cvsd_gid) == -1) { cvs_log(LP_ERRNO, "failed to drop group privileges"); - exit(EX_OSERR); + exit(1); } if (seteuid(cvsd_uid) == -1) { cvs_log(LP_ERRNO, "failed to drop user privileges"); - exit(EX_OSERR); + exit(1); } signal(SIGINFO, cvsd_sighdlr); @@ -323,7 +323,7 @@ cvsd_child_fork(int sock) */ if (dup2(sock, CVSD_CHILD_SOCKFD) == -1) { cvs_log(LP_ERRNO, "failed to dup child socket"); - exit(EX_OSERR); + exit(1); } (void)close(sock); @@ -345,7 +345,7 @@ cvsd_child_fork(int sock) execv(CVSD_PATH_CHILD, argv); err(1, "FUCK"); - exit(EX_OSERR); + exit(1); } cvs_log(LP_INFO, "spawning child %d", pid); diff --git a/usr.bin/cvs/diff.c b/usr.bin/cvs/diff.c index 357c51c54ba..83a84499e13 100644 --- a/usr.bin/cvs/diff.c +++ b/usr.bin/cvs/diff.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diff.c,v 1.24 2005/03/31 14:57:32 joris Exp $ */ +/* $OpenBSD: diff.c,v 1.25 2005/04/03 17:32:50 xsa Exp $ */ /* * Copyright (C) Caldera International Inc. 2001-2002. * All rights reserved. @@ -359,7 +359,7 @@ cvs_diff_options(char *opt, int argc, char **argv, int *arg) dap = (struct diff_arg *)malloc(sizeof(*dap)); if (dap == NULL) - return (EX_DATAERR); + return (-1); dap->date1 = dap->date2 = dap->rev1 = dap->rev2 = NULL; strlcpy(diffargs, argv[0], sizeof(diffargs)); diff --git a/usr.bin/cvs/history.c b/usr.bin/cvs/history.c index 309dd2711a4..2d73db2b4c3 100644 --- a/usr.bin/cvs/history.c +++ b/usr.bin/cvs/history.c @@ -1,4 +1,4 @@ -/* $OpenBSD: history.c,v 1.9 2005/03/30 17:43:04 joris Exp $ */ +/* $OpenBSD: history.c,v 1.10 2005/04/03 17:32:50 xsa Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -153,26 +153,26 @@ cvs_history_sendflags(struct cvsroot *root) { if ((flags & CVS_HF_C) && (cvs_sendarg(root, "-c", 0) < 0)) - return (EX_PROTOCOL); + return (-1); if ((flags & CVS_HF_O) && (cvs_sendarg(root, "-o", 0) < 0)) - return (EX_PROTOCOL); + return (-1); if (tag != NULL) { if ((cvs_sendarg(root, "-t", 0) < 0) || (cvs_sendarg(root, tag, 0) < 0)) - return (EX_PROTOCOL); + return (-1); } if (user != NULL) { if ((cvs_sendarg(root, "-u", 0) < 0) || (cvs_sendarg(root, user, 0) < 0)) - return (EX_PROTOCOL); + return (-1); } if ((cvs_sendarg(root, "-z", 0) < 0) || (cvs_sendarg(root, zone, 0) < 0)) - return (EX_PROTOCOL); + return (-1); return (0); } diff --git a/usr.bin/cvs/import.c b/usr.bin/cvs/import.c index 6a074943601..061c807291f 100644 --- a/usr.bin/cvs/import.c +++ b/usr.bin/cvs/import.c @@ -1,4 +1,4 @@ -/* $OpenBSD: import.c,v 1.7 2005/03/30 17:43:04 joris Exp $ */ +/* $OpenBSD: import.c,v 1.8 2005/04/03 17:32:50 xsa Exp $ */ /* * Copyright (c) 2004 Joris Vink <joris@openbsd.org> * All rights reserved. @@ -92,7 +92,7 @@ cvs_import_options(char *opt, int argc, char **argv, int *arg) cvs_msg = strdup(optarg); if (cvs_msg == NULL) { cvs_log(LP_ERRNO, "failed to copy message"); - return (EX_DATAERR); + return (-1); } break; default: @@ -128,7 +128,7 @@ cvs_import_sendflags(struct cvsroot *root) (cvs_sendarg(root, module, 0) < 0) || (cvs_sendarg(root, vendor, 0) < 0) || (cvs_sendarg(root, release, 0) < 0)) - return (EX_PROTOCOL); + return (-1); return (0); } diff --git a/usr.bin/cvs/init.c b/usr.bin/cvs/init.c index 453cebf765f..0496bdfc609 100644 --- a/usr.bin/cvs/init.c +++ b/usr.bin/cvs/init.c @@ -1,4 +1,4 @@ -/* $OpenBSD: init.c,v 1.12 2005/03/30 17:43:04 joris Exp $ */ +/* $OpenBSD: init.c,v 1.13 2005/04/03 17:32:50 xsa Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -33,7 +33,6 @@ #include <stdlib.h> #include <unistd.h> #include <string.h> -#include <sysexits.h> #include "cvs.h" #include "rcs.h" @@ -80,7 +79,7 @@ struct cvs_cmd_info cvs_init = { * cvs_init_local() * * Local handler for the "cvs init" command. - * Returns 0 on success, or the appropriate exit status on failure. + * Returns 0 on success, -1 on failure. */ int cvs_init_local(struct cvsroot *root) @@ -98,7 +97,7 @@ cvs_init_local(struct cvsroot *root) if (mkdir(path, cvsroot_files[i].cf_mode) == -1) { cvs_log(LP_ERRNO, "failed to create `%s'", path); - return (EX_CANTCREAT); + return (-1); } } else if (cvsroot_files[i].cf_type == CFT_FILE) { fd = open(path, O_WRONLY|O_CREAT|O_EXCL, @@ -106,7 +105,7 @@ cvs_init_local(struct cvsroot *root) if (fd == -1) { cvs_log(LP_ERRNO, "failed to create `%s'", path); - return (EX_CANTCREAT); + return (-1); } (void)close(fd); @@ -114,7 +113,7 @@ cvs_init_local(struct cvsroot *root) strlcat(path, RCS_FILE_EXT, sizeof(path)); rfp = rcs_open(path, RCS_WRITE|RCS_CREATE, 0640); if (rfp == NULL) { - return (EX_CANTCREAT); + return (-1); } rcs_close(rfp); diff --git a/usr.bin/cvs/proto.c b/usr.bin/cvs/proto.c index bb0ae6b904e..d7261493d4b 100644 --- a/usr.bin/cvs/proto.c +++ b/usr.bin/cvs/proto.c @@ -1,4 +1,4 @@ -/* $OpenBSD: proto.c,v 1.45 2005/03/30 17:43:04 joris Exp $ */ +/* $OpenBSD: proto.c,v 1.46 2005/04/03 17:32:50 xsa Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -50,7 +50,6 @@ #include <stdlib.h> #include <unistd.h> #include <string.h> -#include <sysexits.h> #include "buf.h" #include "cvs.h" @@ -260,7 +259,7 @@ cvs_connect(struct cvsroot *root) execvp(argv[0], argv); cvs_log(LP_ERRNO, "failed to exec"); - exit(EX_OSERR); + exit(1); } /* we are the parent */ diff --git a/usr.bin/cvs/server.c b/usr.bin/cvs/server.c index 6ef6659d143..22c4288f7aa 100644 --- a/usr.bin/cvs/server.c +++ b/usr.bin/cvs/server.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server.c,v 1.9 2005/04/01 09:52:39 joris Exp $ */ +/* $OpenBSD: server.c,v 1.10 2005/04/03 17:32:50 xsa Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -78,7 +78,7 @@ cvs_server(int argc, char **argv) if (feof(stdin)) break; else if (ferror(stdin)) - return (EX_DATAERR); + return (-1); } len = strlen(reqbuf); @@ -86,7 +86,7 @@ cvs_server(int argc, char **argv) continue; else if (reqbuf[len - 1] != '\n') { cvs_log(LP_ERR, "truncated request"); - return (EX_DATAERR); + return (-1); } reqbuf[--len] = '\0'; diff --git a/usr.bin/cvs/status.c b/usr.bin/cvs/status.c index ac6192362ea..bc181a11ac9 100644 --- a/usr.bin/cvs/status.c +++ b/usr.bin/cvs/status.c @@ -1,4 +1,4 @@ -/* $OpenBSD: status.c,v 1.10 2005/03/30 17:43:04 joris Exp $ */ +/* $OpenBSD: status.c,v 1.11 2005/04/03 17:32:50 xsa Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -96,7 +96,7 @@ int cvs_status_sendflags(struct cvsroot *root) { if (verbose && (cvs_sendarg(root, "-v", 0) < 0)) - return (EX_PROTOCOL); + return (-1); return (0); } diff --git a/usr.bin/cvs/tag.c b/usr.bin/cvs/tag.c index d7d44adeab9..7433472be83 100644 --- a/usr.bin/cvs/tag.c +++ b/usr.bin/cvs/tag.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tag.c,v 1.7 2005/03/30 17:43:04 joris Exp $ */ +/* $OpenBSD: tag.c,v 1.8 2005/04/03 17:32:50 xsa Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * Copyright (c) 2004 Joris Vink <joris@openbsd.org> @@ -124,25 +124,25 @@ int cvs_tag_sendflags(struct cvsroot *root) { if (branch && (cvs_sendarg(root, "-b", 0) < 0)) - return (EX_PROTOCOL); + return (-1); if (delete && (cvs_sendarg(root, "-d", 0) < 0)) - return (EX_PROTOCOL); + return (-1); if (old_tag) { if ((cvs_sendarg(root, "-r", 0) < 0) || (cvs_sendarg(root, old_tag, 0) < 0)) - return (EX_PROTOCOL); + return (-1); } if (date) { if ((cvs_sendarg(root, "-D", 0) < 0) || (cvs_sendarg(root, date, 0) < 0)) - return (EX_PROTOCOL); + return (-1); } if (cvs_sendarg(root, tag, 0) < 0) - return (EX_PROTOCOL); + return (-1); return (0); } diff --git a/usr.bin/cvs/version.c b/usr.bin/cvs/version.c index b612f30bd2f..96646b16a33 100644 --- a/usr.bin/cvs/version.c +++ b/usr.bin/cvs/version.c @@ -1,4 +1,4 @@ -/* $OpenBSD: version.c,v 1.8 2005/03/30 17:43:04 joris Exp $ */ +/* $OpenBSD: version.c,v 1.9 2005/04/03 17:32:50 xsa Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -31,7 +31,6 @@ #include <unistd.h> #include <errno.h> #include <string.h> -#include <sysexits.h> #include "cvs.h" #include "proto.h" |