diff options
author | Joris Vink <joris@cvs.openbsd.org> | 2005-03-31 15:47:18 +0000 |
---|---|---|
committer | Joris Vink <joris@cvs.openbsd.org> | 2005-03-31 15:47:18 +0000 |
commit | c7c70df8ff047580a65aebb7ff9b66d22c85b378 (patch) | |
tree | c1bad6997b77931fb3d0ed5e01250560eb3e2175 /usr.bin/cvs | |
parent | 327f862a6a0f1f334c0c4f89e5deccff240fceef (diff) |
- as long as we are using the sysexits.h error codes make sure
we handle them.
- handle cmd_sendflags() when it fails.
Diffstat (limited to 'usr.bin/cvs')
-rw-r--r-- | usr.bin/cvs/cmd.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/usr.bin/cvs/cmd.c b/usr.bin/cvs/cmd.c index 91ec5b8df54..78c9e13ccce 100644 --- a/usr.bin/cvs/cmd.c +++ b/usr.bin/cvs/cmd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd.c,v 1.3 2005/03/29 03:10:27 joris Exp $ */ +/* $OpenBSD: cmd.c,v 1.4 2005/03/31 15:47:17 joris Exp $ */ /* * Copyright (c) 2005 Joris Vink <joris@openbsd.org> * All rights reserved. @@ -52,7 +52,7 @@ cvs_startcmd(struct cvs_cmd *cmd, int argc, char **argv) struct cvs_cmd_info *c = cmd->cmd_info; if (c->cmd_options != NULL) { - if ((ret = c->cmd_options(cmd->cmd_opts, argc, argv, &i)) < 0) + if ((ret = c->cmd_options(cmd->cmd_opts, argc, argv, &i))) return (ret); argc -= i; @@ -67,7 +67,7 @@ cvs_startcmd(struct cvs_cmd *cmd, int argc, char **argv) if (cvs_files == NULL) return (EX_DATAERR); - if ((c->cmd_helper != NULL) && ((ret = c->cmd_helper()) < 0)) + if ((c->cmd_helper != NULL) && ((ret = c->cmd_helper()))) return (ret); root = CVS_DIR_ROOT(cvs_files); @@ -90,8 +90,10 @@ cvs_startcmd(struct cvs_cmd *cmd, int argc, char **argv) } } - if (c->cmd_sendflags != NULL) - c->cmd_sendflags(root); + if (c->cmd_sendflags != NULL) { + if ((ret = c->cmd_sendflags(root))) + return (ret); + } if (c->cmd_flags & CVS_CMD_NEEDLOG) { if (cvs_logmsg_send(root, cvs_msg) < 0) |