diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2004-12-07 17:10:57 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2004-12-07 17:10:57 +0000 |
commit | 3dd0eeb90cc3cb05b003f511986aa48b242af672 (patch) | |
tree | 79eca74f76f32cb4adc73bf57472ab27577ef963 /usr.bin/cvs | |
parent | 2348195e75220fe47d1af53445293fc2d0b616d4 (diff) |
less whitespace, more pretty. ok jfb
Diffstat (limited to 'usr.bin/cvs')
41 files changed, 321 insertions, 562 deletions
diff --git a/usr.bin/cvs/add.c b/usr.bin/cvs/add.c index ea69323dc79..c1dc703d9f8 100644 --- a/usr.bin/cvs/add.c +++ b/usr.bin/cvs/add.c @@ -1,16 +1,16 @@ -/* $OpenBSD: add.c,v 1.7 2004/12/06 21:03:12 deraadt Exp $ */ +/* $OpenBSD: add.c,v 1.8 2004/12/07 17:10:56 tedu Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> - * All rights reserved. + * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. * 2. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY @@ -21,7 +21,7 @@ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include <sys/types.h> @@ -52,7 +52,6 @@ int cvs_add_file (CVSFILE *, void *); * Handler for the `cvs add' command. * Returns 0 on success, or one of the known system exit codes on failure. */ - int cvs_add(int argc, char **argv) { diff --git a/usr.bin/cvs/buf.c b/usr.bin/cvs/buf.c index 7efbec219a4..d9ae11b87f4 100644 --- a/usr.bin/cvs/buf.c +++ b/usr.bin/cvs/buf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: buf.c,v 1.5 2004/12/06 21:03:12 deraadt Exp $ */ +/* $OpenBSD: buf.c,v 1.6 2004/12/07 17:10:56 tedu Exp $ */ /* * Copyright (c) 2003 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -70,7 +70,6 @@ static ssize_t cvs_buf_grow (BUF *, size_t); * uses dynamically-allocated memory and must be freed with cvs_buf_free(), * once the buffer is no longer needed. */ - BUF* cvs_buf_alloc(size_t len, u_int flags) { @@ -106,7 +105,6 @@ cvs_buf_alloc(size_t len, u_int flags) * buffer. * Returns the loaded buffer on success, or NULL on failure. */ - BUF* cvs_buf_load(const char *path, u_int flags) { @@ -160,7 +158,6 @@ cvs_buf_load(const char *path, u_int flags) * * Free the buffer <b> and all associated data. */ - void cvs_buf_free(BUF *b) { @@ -176,11 +173,11 @@ cvs_buf_free(BUF *b) * of the buffer. Instead, they are returned and should be freed later using * free(). */ - void* cvs_buf_release(BUF *b) { void *tmp; + tmp = b->cb_buf; free(b); return (tmp); @@ -192,7 +189,6 @@ cvs_buf_release(BUF *b) * * Empty the contents of the buffer <b> and reset pointers. */ - void cvs_buf_empty(BUF *b) { @@ -208,7 +204,6 @@ cvs_buf_empty(BUF *b) * <off> in the destination buffer <dst>, which can accept up to <len> bytes. * Returns the number of bytes successfully copied, or -1 on failure. */ - ssize_t cvs_buf_copy(BUF *b, size_t off, void *dst, size_t len) { @@ -231,14 +226,13 @@ cvs_buf_copy(BUF *b, size_t off, void *dst, size_t len) * at <src>. If the buffer was not created with BUF_AUTOEXT, as many bytes * as possible will be copied in the buffer. */ - int cvs_buf_set(BUF *b, const void *src, size_t len, size_t off) { size_t rlen; if (b->cb_size < (len + off)) { - if ((b->cb_flags & BUF_AUTOEXT) && (cvs_buf_grow(b, + if ((b->cb_flags & BUF_AUTOEXT) && (cvs_buf_grow(b, len + off - b->cb_size) < 0)) return (-1); else @@ -263,7 +257,6 @@ cvs_buf_set(BUF *b, const void *src, size_t len, size_t off) * Append a single character <c> to the end of the buffer <b>. * Returns 0 on success, or -1 on failure. */ - int cvs_buf_putc(BUF *b, int c) { @@ -296,7 +289,6 @@ cvs_buf_putc(BUF *b, int c) * Returns the number of bytes successfully appended to the buffer, or -1 * on failure. */ - ssize_t cvs_buf_append(BUF *b, const void *data, size_t len) { @@ -328,7 +320,6 @@ cvs_buf_append(BUF *b, const void *data, size_t len) * cvs_buf_fappend() * */ - int cvs_buf_fappend(BUF *b, const char *fmt, ...) { @@ -356,7 +347,6 @@ cvs_buf_fappend(BUF *b, const char *fmt, ...) * * Returns the size of the buffer that is being used. */ - size_t cvs_buf_size(BUF *b) { @@ -369,7 +359,6 @@ cvs_buf_size(BUF *b) * * Peek at the contents of the buffer <b> at offset <off>. */ - const void* cvs_buf_peek(BUF *b, size_t off) { @@ -386,7 +375,6 @@ cvs_buf_peek(BUF *b, size_t off) * Write the contents of the buffer <b> to the file whose path is given in * <path>. If the file does not exist, it is created with mode <mode>. */ - int cvs_buf_write(BUF *b, const char *path, mode_t mode) { @@ -430,7 +418,6 @@ cvs_buf_write(BUF *b, const char *path, mode_t mode) * operation regardless of the result. * Returns the new size on success, or -1 on failure. */ - static ssize_t cvs_buf_grow(BUF *b, size_t len) { diff --git a/usr.bin/cvs/cache.c b/usr.bin/cvs/cache.c index cdd0922c21e..e090ff36801 100644 --- a/usr.bin/cvs/cache.c +++ b/usr.bin/cvs/cache.c @@ -1,16 +1,16 @@ -/* $OpenBSD: cache.c,v 1.1 2004/07/13 22:02:40 jfb Exp $ */ +/* $OpenBSD: cache.c,v 1.2 2004/12/07 17:10:56 tedu Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> - * All rights reserved. + * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. * 2. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY @@ -21,7 +21,7 @@ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include <sys/param.h> @@ -70,7 +70,6 @@ u_int rcs_cache_nbent; * Initialize the RCS file data cache. * Returns 0 on success, -1 on failure. */ - int rcs_cache_init(u_int maxent) { @@ -91,7 +90,6 @@ rcs_cache_init(u_int maxent) /* * rcs_cache_destroy() */ - void rcs_cache_destroy(void) { @@ -102,7 +100,6 @@ rcs_cache_destroy(void) * rcs_cache_fetch() * */ - RCSFILE* rcs_cache_fetch(const char *path) { @@ -144,7 +141,6 @@ rcs_cache_fetch(const char *path) * should still rcs_close() the file once they are done with it. * Returns 0 on success, or -1 on failure. */ - int rcs_cache_store(RCSFILE *rfp) { @@ -191,7 +187,6 @@ rcs_cache_store(RCSFILE *rfp) * * Hash the <path> string. */ - static u_int8_t rcs_cache_hash(const char *path) { diff --git a/usr.bin/cvs/cache.h b/usr.bin/cvs/cache.h index 33b2a485f5b..de815066785 100644 --- a/usr.bin/cvs/cache.h +++ b/usr.bin/cvs/cache.h @@ -1,16 +1,16 @@ -/* $OpenBSD: cache.h,v 1.1 2004/07/13 22:02:40 jfb Exp $ */ +/* $OpenBSD: cache.h,v 1.2 2004/12/07 17:10:56 tedu Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> - * All rights reserved. + * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. * 2. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY @@ -21,7 +21,7 @@ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef CACHE_H diff --git a/usr.bin/cvs/checkout.c b/usr.bin/cvs/checkout.c index b74356d99cd..30d96494d0e 100644 --- a/usr.bin/cvs/checkout.c +++ b/usr.bin/cvs/checkout.c @@ -1,16 +1,16 @@ -/* $OpenBSD: checkout.c,v 1.10 2004/11/26 16:05:13 jfb Exp $ */ +/* $OpenBSD: checkout.c,v 1.11 2004/12/07 17:10:56 tedu Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> - * All rights reserved. + * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. * 2. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY @@ -21,7 +21,7 @@ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include <sys/types.h> @@ -46,7 +46,6 @@ * Handler for the `cvs checkout' command. * Returns 0 on success, or one of the known system exit codes on failure. */ - int cvs_checkout(int argc, char **argv) { diff --git a/usr.bin/cvs/commit.c b/usr.bin/cvs/commit.c index 64510de8243..3e45dfc6d05 100644 --- a/usr.bin/cvs/commit.c +++ b/usr.bin/cvs/commit.c @@ -1,16 +1,16 @@ -/* $OpenBSD: commit.c,v 1.8 2004/12/06 21:03:12 deraadt Exp $ */ +/* $OpenBSD: commit.c,v 1.9 2004/12/07 17:10:56 tedu Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> - * All rights reserved. + * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. * 2. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY @@ -21,7 +21,7 @@ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include <sys/types.h> @@ -53,7 +53,6 @@ int cvs_commit_file (CVSFILE *, void *); * * Handler for the `cvs commit' command. */ - int cvs_commit(int argc, char **argv) { @@ -142,7 +141,6 @@ cvs_commit(int argc, char **argv) * Examine the file <cf> to see if it will be part of the commit, in which * case it gets added to the list passed as second argument. */ - int cvs_commit_prepare(CVSFILE *cf, void *arg) { @@ -166,7 +164,6 @@ cvs_commit_prepare(CVSFILE *cf, void *arg) * * Commit a single file. */ - int cvs_commit_file(CVSFILE *cf, void *arg) { diff --git a/usr.bin/cvs/cvs.c b/usr.bin/cvs/cvs.c index b01f0414e64..92defc915d7 100644 --- a/usr.bin/cvs/cvs.c +++ b/usr.bin/cvs/cvs.c @@ -1,16 +1,16 @@ -/* $OpenBSD: cvs.c,v 1.17 2004/12/07 06:33:10 jfb Exp $ */ +/* $OpenBSD: cvs.c,v 1.18 2004/12/07 17:10:56 tedu Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> - * All rights reserved. + * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. * 2. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY @@ -21,7 +21,7 @@ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include <sys/types.h> @@ -48,8 +48,6 @@ extern char *__progname; /* verbosity level: 0 = really quiet, 1 = quiet, 2 = verbose */ int verbosity = 2; - - /* compression level used with zlib, 0 meaning no compression taking place */ int cvs_compress = 0; int cvs_readrc = 1; /* read .cvsrc on startup */ @@ -67,12 +65,10 @@ char *cvs_editor = CVS_EDITOR_DEFAULT; char *cvs_msg = NULL; - /* hierarchy of all the files affected by the command */ CVSFILE *cvs_files; - /* * Command dispatch table * ---------------------- @@ -85,7 +81,6 @@ CVSFILE *cvs_files; * returned is EX_USAGE, the command's usage string is printed to standard * error before returning. */ - static struct cvs_cmd { int cmd_op; char cmd_name[CVS_CMD_MAXNAMELEN]; @@ -319,7 +314,6 @@ int cvs_getopt (int, char **); * * Display usage information. */ - void usage(void) { @@ -494,7 +488,7 @@ cvs_getopt(int argc, char **argv) */ break; case 'z': - cvs_compress = (int)strtol(optarg, &ep, 10); + cvs_compress = (int)strtol(optarg, &ep, 10); if (*ep != '\0') errx(1, "error parsing compression level"); if (cvs_compress < 0 || cvs_compress > 9) @@ -522,7 +516,6 @@ cvs_getopt(int argc, char **argv) * aliases matches <cmd>. * Returns a pointer to the command entry on success, NULL on failure. */ - struct cvs_cmd* cvs_findcmd(const char *cmd) { @@ -555,7 +548,6 @@ cvs_findcmd(const char *cmd) * exists, it should contain a list of arguments that should always be given * implicitly to the specified commands. */ - void cvs_read_rcfile(void) { diff --git a/usr.bin/cvs/cvs.h b/usr.bin/cvs/cvs.h index 20ec1ac2256..de53f601ac4 100644 --- a/usr.bin/cvs/cvs.h +++ b/usr.bin/cvs/cvs.h @@ -1,16 +1,16 @@ -/* $OpenBSD: cvs.h,v 1.34 2004/12/07 06:33:10 jfb Exp $ */ +/* $OpenBSD: cvs.h,v 1.35 2004/12/07 17:10:56 tedu Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> - * All rights reserved. + * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. * 2. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY @@ -21,7 +21,7 @@ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef CVS_H @@ -67,7 +67,6 @@ #define CVS_OP_ANY 64 /* all operations */ - /* methods */ #define CVS_METHOD_NONE 0 #define CVS_METHOD_LOCAL 1 /* local access */ @@ -129,7 +128,6 @@ struct cvs_op { }; - struct cvsroot { char *cr_str; u_int cr_method; @@ -197,7 +195,6 @@ typedef struct cvs_entries { } CVSENTRIES; - struct cvs_hent { char ch_event; time_t ch_date; @@ -239,7 +236,6 @@ extern CVSFILE *cvs_files; #endif - /* client command handlers */ int cvs_add (int, char **); int cvs_checkout (int, char **); diff --git a/usr.bin/cvs/cvsd.c b/usr.bin/cvs/cvsd.c index b80b9180bc7..92871a8c793 100644 --- a/usr.bin/cvs/cvsd.c +++ b/usr.bin/cvs/cvsd.c @@ -1,16 +1,16 @@ -/* $OpenBSD: cvsd.c,v 1.13 2004/12/06 21:03:12 deraadt Exp $ */ +/* $OpenBSD: cvsd.c,v 1.14 2004/12/07 17:10:56 tedu Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> - * All rights reserved. + * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. * 2. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY @@ -21,7 +21,7 @@ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include <sys/param.h> @@ -58,7 +58,6 @@ static void cvsd_report (void); extern char *__progname; - int cvsd_fg = 0; uid_t cvsd_uid = -1; gid_t cvsd_gid = -1; @@ -92,7 +91,6 @@ int cvsd_msghdlr (struct cvsd_child *, int); * * Generic signal handler. */ - void cvsd_sighdlr(int signo) { @@ -120,7 +118,6 @@ cvsd_sighdlr(int signo) * * Display program usage. */ - void usage(void) { @@ -275,7 +272,6 @@ main(int argc, char **argv) * * Drop privileges. */ - int cvsd_privdrop(void) { @@ -304,7 +300,6 @@ cvsd_privdrop(void) * weird of loose permissions. * Returns the number of warnings on success, or -1 on failure. */ - int cvsd_checkperms(const char *path) { @@ -410,7 +405,6 @@ cvsd_checkperms(const char *path) * On success, returns 0 in the child process context, 1 in the parent's * context, or -1 on failure. */ - int cvsd_child_fork(struct cvsd_child **chpp) { @@ -491,7 +485,6 @@ cvsd_child_fork(struct cvsd_child **chpp) * at least <cvsd_chmin> children in it. * Returns 0 on success, or -1 on failure. */ - int cvsd_child_reap(void) { @@ -543,7 +536,6 @@ cvsd_child_reap(void) * created unless the number of children has attained the maximum, in which * case NULL is returned. */ - struct cvsd_child* cvsd_child_get(void) { @@ -570,7 +562,6 @@ cvsd_child_get(void) * local socket for requests from the cvs(1) program and on any outstanding * messages from the children. */ - static void cvsd_parent_loop(void) { @@ -680,7 +671,6 @@ cvsd_parent_loop(void) * cvsd_child_main() * */ - static void cvsd_child_main(void) { @@ -755,7 +745,6 @@ cvsd_child_main(void) * Handler for messages received from child processes. * Returns 0 on success, or -1 on failure. */ - int cvsd_msghdlr(struct cvsd_child *child, int fd) { @@ -794,7 +783,7 @@ cvsd_msghdlr(struct cvsd_child *child, int fd) switch (msg.cm_type) { case CVSD_MSG_GETUID: rbuf[ret] = '\0'; - cvs_log(LP_INFO, "getting UID for `%s'", rbuf); + cvs_log(LP_INFO, "getting UID for `%s'", rbuf); pw = getpwnam(rbuf); if (pw != NULL) { @@ -806,7 +795,7 @@ cvsd_msghdlr(struct cvsd_child *child, int fd) break; case CVSD_MSG_GETUNAME: memcpy(&uid, rbuf, sizeof(uid)); - cvs_log(LP_INFO, "getting username for UID %u", uid); + cvs_log(LP_INFO, "getting username for UID %u", uid); pw = getpwuid(uid); if (pw != NULL) { msg.cm_type = CVSD_MSG_UNAME; @@ -817,7 +806,7 @@ cvsd_msghdlr(struct cvsd_child *child, int fd) break; case CVSD_MSG_GETGID: rbuf[ret] = '\0'; - cvs_log(LP_INFO, "getting GID for `%s'", rbuf); + cvs_log(LP_INFO, "getting GID for `%s'", rbuf); gr = getgrnam(rbuf); if (gr != NULL) { @@ -849,7 +838,6 @@ cvsd_msghdlr(struct cvsd_child *child, int fd) * a new buffer. * Returns 0 on success, or -1 on failure. */ - int cvsd_set(int what, ...) { @@ -925,7 +913,6 @@ cvsd_set(int what, ...) /* * cvsd_report() */ - static void cvsd_report(void) { diff --git a/usr.bin/cvs/cvsd.h b/usr.bin/cvs/cvsd.h index 29a7f37876e..4a271478c26 100644 --- a/usr.bin/cvs/cvsd.h +++ b/usr.bin/cvs/cvsd.h @@ -1,16 +1,16 @@ -/* $OpenBSD: cvsd.h,v 1.6 2004/11/09 20:51:33 krapht Exp $ */ +/* $OpenBSD: cvsd.h,v 1.7 2004/12/07 17:10:56 tedu Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> - * All rights reserved. + * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. * 2. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY @@ -21,7 +21,7 @@ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef CVSD_H @@ -48,7 +48,6 @@ #define CVSD_CHILD_DEFMAX 5 - #define CVSD_FPERM (S_IRUSR | S_IWUSR) #define CVSD_DPERM (S_IRWXU) @@ -91,7 +90,6 @@ #define CVSD_ST_STOPPED 4 - /* message structure to pass data between the parent and the chrooted child */ struct cvsd_msg { u_int8_t cm_type; @@ -129,12 +127,10 @@ struct cvsd_child { }; - extern uid_t cvsd_uid; extern gid_t cvsd_gid; - int cvsd_set (int, ...); int cvsd_checkperms (const char *); int cvsd_child_fork (struct cvsd_child **); diff --git a/usr.bin/cvs/diff.c b/usr.bin/cvs/diff.c index 5c4782ab0b9..a2beaac108a 100644 --- a/usr.bin/cvs/diff.c +++ b/usr.bin/cvs/diff.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diff.c,v 1.10 2004/12/06 21:03:12 deraadt Exp $ */ +/* $OpenBSD: diff.c,v 1.11 2004/12/07 17:10:56 tedu Exp $ */ /* * Copyright (C) Caldera International Inc. 2001-2002. * All rights reserved. @@ -242,7 +242,6 @@ static int files_differ(FILE *, FILE *); static char *preadline(int, size_t, off_t); - extern int cvs_client; static int aflag, bflag, dflag, iflag, Nflag, tflag, Tflag, wflag; @@ -278,8 +277,6 @@ static int lastline; static int lastmatchline; - - /* * chrtran points to one of 2 translation tables: cup2low if folding upper to * lower case clow2low if not folding case @@ -339,7 +336,6 @@ u_char cup2low[256] = { }; - /* * cvs_diff() * @@ -347,7 +343,6 @@ u_char cup2low[256] = { * * SYNOPSIS: cvs [args] diff [-clipu] [-D date] [-r rev] */ - int cvs_diff(int argc, char **argv) { @@ -439,7 +434,6 @@ cvs_diff(int argc, char **argv) * cvs_diff_sendflags() * */ - int cvs_diff_sendflags(struct cvsroot *root, struct diff_arg *dap) { @@ -473,7 +467,6 @@ cvs_diff_sendflags(struct cvsroot *root, struct diff_arg *dap) * * Diff a single file. */ - int cvs_diff_file(struct cvs_file *cfp, void *arg) { diff --git a/usr.bin/cvs/entries.c b/usr.bin/cvs/entries.c index d9eb0c6b705..d9526c14734 100644 --- a/usr.bin/cvs/entries.c +++ b/usr.bin/cvs/entries.c @@ -1,16 +1,16 @@ -/* $OpenBSD: entries.c,v 1.19 2004/12/06 21:03:12 deraadt Exp $ */ +/* $OpenBSD: entries.c,v 1.20 2004/12/07 17:10:56 tedu Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> - * All rights reserved. + * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. * 2. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY @@ -21,7 +21,7 @@ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include <sys/param.h> @@ -41,7 +41,6 @@ #define CVS_ENTRIES_DELIM '/' - /* * cvs_ent_open() * @@ -49,7 +48,6 @@ * Returns a pointer to the CVSENTRIES file structure on success, or NULL * on failure. */ - CVSENTRIES* cvs_ent_open(const char *dir, int flags) { @@ -147,7 +145,6 @@ cvs_ent_open(const char *dir, int flags) * Close the Entries file <ep> and free all data. Any reference to entries * structure within that file become invalid. */ - void cvs_ent_close(CVSENTRIES *ep) { @@ -183,7 +180,6 @@ cvs_ent_close(CVSENTRIES *ep) * opened for writing. * Returns 0 on success, or -1 on failure. */ - int cvs_ent_add(CVSENTRIES *ef, struct cvs_ent *ent) { @@ -208,7 +204,6 @@ cvs_ent_add(CVSENTRIES *ef, struct cvs_ent *ent) * * Add a line to the Entries file. */ - int cvs_ent_addln(CVSENTRIES *ef, const char *line) { @@ -239,7 +234,6 @@ cvs_ent_addln(CVSENTRIES *ef, const char *line) * Remove an entry from the Entries file <ef>. The entry's name is given * by <name>. */ - int cvs_ent_remove(CVSENTRIES *ef, const char *name) { @@ -270,7 +264,6 @@ cvs_ent_remove(CVSENTRIES *ef, const char *name) * <file>. * Returns a pointer to the cvs entry structure on success, or NULL on failure. */ - struct cvs_ent* cvs_ent_get(CVSENTRIES *ef, const char *file) { @@ -292,7 +285,6 @@ cvs_ent_get(CVSENTRIES *ef, const char *file) * will return the entry following the last one returned. * Returns a pointer to the cvs entry structure on success, or NULL on failure. */ - struct cvs_ent* cvs_ent_next(CVSENTRIES *ef) { @@ -310,7 +302,6 @@ cvs_ent_next(CVSENTRIES *ef) * Parse a single line from a CVS/Entries file and return a cvs_entry structure * containing all the parsed information. */ - struct cvs_ent* cvs_ent_parse(const char *entry) { @@ -378,7 +369,6 @@ cvs_ent_parse(const char *entry) * * Free a single CVS entries structure. */ - void cvs_ent_free(struct cvs_ent *ent) { @@ -397,7 +387,6 @@ cvs_ent_free(struct cvs_ent *ent) * path <path> and return that entry. That entry must later be freed using * cvs_ent_free(). */ - struct cvs_ent* cvs_ent_getent(const char *path) { @@ -428,7 +417,6 @@ cvs_ent_getent(const char *path) * Explicitly write the contents of the Entries file <ef> to disk. * Returns 0 on success, or -1 on failure. */ - int cvs_ent_write(CVSENTRIES *ef) { diff --git a/usr.bin/cvs/event.h b/usr.bin/cvs/event.h index 585591d2ff6..4b8ee21a1cb 100644 --- a/usr.bin/cvs/event.h +++ b/usr.bin/cvs/event.h @@ -1,16 +1,16 @@ -/* $OpenBSD: event.h,v 1.2 2004/07/25 03:32:05 jfb Exp $ */ +/* $OpenBSD: event.h,v 1.3 2004/12/07 17:10:56 tedu Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> - * All rights reserved. + * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. * 2. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY @@ -21,7 +21,7 @@ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef EVENT_H @@ -34,7 +34,6 @@ #include <pwd.h> - #define CVS_EVENT_ADD 1 #define CVS_EVENT_ANNOTATE 2 #define CVS_EVENT_CHECKOUT 3 @@ -57,5 +56,4 @@ struct cvs_event { LIST_HEAD(, cvs_file) ev_files; /* files affected by this event */ }; - #endif /* EVENT_H */ diff --git a/usr.bin/cvs/file.c b/usr.bin/cvs/file.c index 97efd5587f8..fc6974ea9c5 100644 --- a/usr.bin/cvs/file.c +++ b/usr.bin/cvs/file.c @@ -1,4 +1,4 @@ -/* $OpenBSD: file.c,v 1.38 2004/12/06 21:03:12 deraadt Exp $ */ +/* $OpenBSD: file.c,v 1.39 2004/12/07 17:10:56 tedu Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -59,7 +59,6 @@ struct cvs_ignpat { /* * Standard patterns to ignore. */ - static const char *cvs_ign_std[] = { ".", "..", @@ -89,7 +88,6 @@ static const char *cvs_ign_std[] = { * Filename hash table used to avoid duplication of name strings when working * on large source trees with common parts. */ - SLIST_HEAD(cvs_fhb, cvs_fname); static struct cvs_fhb cvs_fnht[CVS_FILE_NBUCKETS]; @@ -122,7 +120,6 @@ static CVSFILE* cvs_file_lget (const char *, int, CVSFILE *); * cvs_file_init() * */ - int cvs_file_init(void) { @@ -180,7 +177,6 @@ cvs_file_init(void) * Add the pattern <pat> to the list of patterns for files to ignore. * Returns 0 on success, or -1 on failure. */ - int cvs_file_ignore(const char *pat) { @@ -216,7 +212,6 @@ cvs_file_ignore(const char *pat) * Returns 1 if the filename <file> is matched by one of the ignore * patterns, or 0 otherwise. */ - int cvs_file_chkign(const char *file) { @@ -247,7 +242,6 @@ cvs_file_chkign(const char *file) * created. * Returns the created file on success, or NULL on failure. */ - CVSFILE* cvs_file_create(CVSFILE *parent, const char *path, u_int type, mode_t mode) { @@ -301,7 +295,6 @@ cvs_file_create(CVSFILE *parent, const char *path, u_int type, mode_t mode) * Returns the copied file on success, or NULL on failure. The returned * structure should be freed using cvs_file_free(). */ - CVSFILE* cvs_file_copy(CVSFILE *orig) { @@ -358,7 +351,6 @@ cvs_file_get(const char *path, int flags) * Returns a pointer to the lowest common subdirectory to all specified * files. */ - CVSFILE* cvs_file_getspec(char **fspec, int fsn, int flags) { @@ -410,7 +402,6 @@ cvs_file_getspec(char **fspec, int fsn, int flags) * The file's pathname <path> must be relative to the base of <hier>. * Returns the entry on success, or NULL on failure. */ - CVSFILE* cvs_file_find(CVSFILE *hier, const char *path) { @@ -463,7 +454,6 @@ cvs_file_find(CVSFILE *hier, const char *path) * at least MAXPATHLEN bytes long. * Returns a pointer to the start of the path on success, or NULL on failure. */ - char* cvs_file_getpath(CVSFILE *file, char *buf, size_t len) { @@ -509,7 +499,6 @@ cvs_file_getpath(CVSFILE *file, char *buf, size_t len) * has to be a file of type DT_DIR. * Returns 0 on success, or -1 on failure. */ - int cvs_file_attach(CVSFILE *parent, CVSFILE *file) { @@ -535,7 +524,6 @@ cvs_file_attach(CVSFILE *parent, CVSFILE *file) * This function should not free the directory information on error, as this * is performed by cvs_file_free(). */ - static int cvs_file_getdir(CVSFILE *cf, int flags) { @@ -655,7 +643,6 @@ cvs_file_getdir(CVSFILE *cf, int flags) * * Free a cvs_file structure and its contents. */ - void cvs_file_free(CVSFILE *cf) { @@ -672,7 +659,6 @@ cvs_file_free(CVSFILE *cf) * <exam>. The function is called for all subdirectories and files of the * root file. */ - int cvs_file_examine(CVSFILE *cf, int (*exam)(CVSFILE *, void *), void *arg) { @@ -698,7 +684,6 @@ cvs_file_examine(CVSFILE *cf, int (*exam)(CVSFILE *, void *), void *arg) * * Free a cvs_dir structure and its contents. */ - static void cvs_file_freedir(struct cvs_dir *cd) { @@ -728,7 +713,6 @@ cvs_file_freedir(struct cvs_dir *cd) * in the list must be given by <nfiles>. * Returns 0 on success, or -1 on failure. */ - static int cvs_file_sort(struct cvs_flist *flp, u_int nfiles) { @@ -790,7 +774,6 @@ cvs_file_cmp(const void *f1, const void *f2) * * Allocate a CVSFILE structure and initialize its internals. */ - CVSFILE* cvs_file_alloc(const char *path, u_int type) { @@ -848,7 +831,6 @@ cvs_file_alloc(const char *path, u_int type) * Returns a pointer to the created file structure on success, or NULL on * failure. */ - static CVSFILE* cvs_file_lget(const char *path, int flags, CVSFILE *parent) { @@ -921,7 +903,6 @@ cvs_file_cmpname(const char *name1, const char *name2) * Generate an 8 bit hash value from the name of a file. * XXX Improve my distribution! */ - static u_int8_t cvs_file_hashname(const char *name) { @@ -943,7 +924,6 @@ cvs_file_hashname(const char *name) * If no entry is found for that name, a new one is created and inserted into * the table. The name's reference count is increased. */ - static struct cvs_fname* cvs_file_getname(const char *name) { diff --git a/usr.bin/cvs/file.h b/usr.bin/cvs/file.h index 9c2c3c0ea4b..70a2042e7bd 100644 --- a/usr.bin/cvs/file.h +++ b/usr.bin/cvs/file.h @@ -1,16 +1,16 @@ -/* $OpenBSD: file.h,v 1.10 2004/12/02 06:54:15 jfb Exp $ */ +/* $OpenBSD: file.h,v 1.11 2004/12/07 17:10:56 tedu Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> - * All rights reserved. + * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. * 2. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY @@ -21,7 +21,7 @@ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef FILE_H @@ -41,7 +41,6 @@ struct cvs_entries; #define CVS_FILE_NBUCKETS 256 - #define CF_STAT 0x01 /* obsolete */ #define CF_IGNORE 0x02 /* apply regular ignore rules */ #define CF_RECURSE 0x04 /* recurse on directory operations */ @@ -65,7 +64,6 @@ struct cvs_entries; * a cvs_dir structure containing data specific to the directory (such as * the contents of the directory's CVS/Entries, CVS/Root, etc.). */ - #define CVS_FST_UNKNOWN 0 #define CVS_FST_UPTODATE 1 #define CVS_FST_MODIFIED 2 @@ -74,7 +72,7 @@ struct cvs_entries; #define CVS_FST_CONFLICT 5 #define CVS_FST_PATCHED 6 - + struct cvs_fname { char *cf_name; u_int cf_ref; diff --git a/usr.bin/cvs/getlog.c b/usr.bin/cvs/getlog.c index cb267f44f0b..db893c546d6 100644 --- a/usr.bin/cvs/getlog.c +++ b/usr.bin/cvs/getlog.c @@ -1,16 +1,16 @@ -/* $OpenBSD: getlog.c,v 1.9 2004/12/06 21:03:12 deraadt Exp $ */ +/* $OpenBSD: getlog.c,v 1.10 2004/12/07 17:10:56 tedu Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> - * All rights reserved. + * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. * 2. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY @@ -21,7 +21,7 @@ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include <sys/param.h> @@ -48,7 +48,7 @@ #define CVS_GETLOG_REVEND \ "=============================================================================" -#ifdef notyet +#ifdef notyet static void cvs_getlog_print (const char *, RCSFILE *, u_int); #endif static int cvs_getlog_file (CVSFILE *, void *); @@ -60,7 +60,6 @@ static int cvs_getlog_file (CVSFILE *, void *); * * Implement the `cvs log' command. */ - int cvs_getlog(int argc, char **argv) { @@ -123,7 +122,6 @@ cvs_getlog(int argc, char **argv) * * Diff a single file. */ - static int cvs_getlog_file(CVSFILE *cf, void *arg) { diff --git a/usr.bin/cvs/hist.c b/usr.bin/cvs/hist.c index c3ee3283869..207233b4681 100644 --- a/usr.bin/cvs/hist.c +++ b/usr.bin/cvs/hist.c @@ -1,16 +1,16 @@ -/* $OpenBSD: hist.c,v 1.2 2004/12/06 21:03:12 deraadt Exp $ */ +/* $OpenBSD: hist.c,v 1.3 2004/12/07 17:10:56 tedu Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> - * All rights reserved. + * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. * 2. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY @@ -21,7 +21,7 @@ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include <sys/param.h> @@ -44,16 +44,12 @@ static int cvs_hist_fillbuf (CVSHIST *); static int cvs_hist_fmt (const struct cvs_hent *, char *, size_t); - - - /* * cvs_hist_open() * * Open a CVS history file. * Returns the number of entries in the file on success, or -1 on error. */ - CVSHIST* cvs_hist_open(const char *path) { @@ -100,7 +96,6 @@ cvs_hist_open(const char *path) * * Close the CVS history file previously opened by a call to cvs_hist_open() */ - void cvs_hist_close(CVSHIST *histp) { @@ -120,7 +115,6 @@ cvs_hist_close(CVSHIST *histp) * Returns the next entry from the file on success, or NULL on failure or if * no entries are left. */ - struct cvs_hent* cvs_hist_getnext(CVSHIST *histp) { @@ -140,7 +134,6 @@ cvs_hist_getnext(CVSHIST *histp) * first set to the end of the file. * Returns 0 on success, or -1 on failure. */ - int cvs_hist_append(CVSHIST *histp, struct cvs_hent *hentp) { @@ -172,7 +165,6 @@ cvs_hist_append(CVSHIST *histp, struct cvs_hent *hentp) * * Fill the history file's internal buffer for future parsing. */ - static int cvs_hist_fillbuf(CVSHIST *histp) { @@ -202,7 +194,6 @@ cvs_hist_fillbuf(CVSHIST *histp) * the buffered history entries. * Returns the number of entries parsed on success, or -1 on failure. */ - int cvs_hist_parse(CVSHIST *histp) { @@ -282,17 +273,15 @@ cvs_hist_parse(CVSHIST *histp) * the CVS `history' file, and store the resulting string in <buf>, which is * of size <blen>. */ - static int cvs_hist_fmt(const struct cvs_hent *ent, char *buf, size_t blen) { char numbuf[64]; - if (rcsnum_tostr(ent->ch_rev, numbuf, sizeof(numbuf)) == NULL) { + if (rcsnum_tostr(ent->ch_rev, numbuf, sizeof(numbuf)) == NULL) return (-1); - } - return snprintf(buf, blen, "%c%8x|%s|%s|%s|%s|%s", + return (snprintf(buf, blen, "%c%8x|%s|%s|%s|%s|%s", ent->ch_event, ent->ch_date, ent->ch_user, ent->ch_curdir, - ent->ch_repo, numbuf, ent->ch_arg); + ent->ch_repo, numbuf, ent->ch_arg)); } diff --git a/usr.bin/cvs/history.c b/usr.bin/cvs/history.c index 294926da387..956e77811fa 100644 --- a/usr.bin/cvs/history.c +++ b/usr.bin/cvs/history.c @@ -1,16 +1,16 @@ -/* $OpenBSD: history.c,v 1.4 2004/12/06 21:03:12 deraadt Exp $ */ +/* $OpenBSD: history.c,v 1.5 2004/12/07 17:10:56 tedu Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> - * All rights reserved. + * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. * 2. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY @@ -21,7 +21,7 @@ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include <sys/param.h> @@ -65,7 +65,6 @@ extern char *__progname; * * Handle the `cvs history' command. */ - int cvs_history(int argc, char **argv) { diff --git a/usr.bin/cvs/import.c b/usr.bin/cvs/import.c index 894e0ef0e7e..0e8a4a1c272 100644 --- a/usr.bin/cvs/import.c +++ b/usr.bin/cvs/import.c @@ -1,4 +1,4 @@ -/* $OpenBSD: import.c,v 1.1 2004/11/09 20:46:02 krapht Exp $ */ +/* $OpenBSD: import.c,v 1.2 2004/12/07 17:10:56 tedu Exp $ */ /* * Copyright (c) 2004 Joris Vink <amni@pandora.be> * All rights reserved. @@ -122,7 +122,7 @@ do_import(struct cvsroot *root, char **argv) cvs_sendarg(root, argv[1], 0) < 0 || cvs_sendarg(root, argv[2], 0) < 0) { cvs_log(LP_ERR, "failed to send arguments"); - return (-1); + return (-1); } /* create the repository name */ diff --git a/usr.bin/cvs/init.c b/usr.bin/cvs/init.c index 108f33b2a6d..53ece574b37 100644 --- a/usr.bin/cvs/init.c +++ b/usr.bin/cvs/init.c @@ -1,16 +1,16 @@ -/* $OpenBSD: init.c,v 1.7 2004/12/06 21:03:12 deraadt Exp $ */ +/* $OpenBSD: init.c,v 1.8 2004/12/07 17:10:56 tedu Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> - * All rights reserved. + * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. * 2. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY @@ -21,7 +21,7 @@ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include <sys/param.h> @@ -67,7 +67,6 @@ struct cvsroot_file { }; - /* * cvs_init() * @@ -75,7 +74,6 @@ struct cvsroot_file { * repository. * Returns 0 on success, or the appropriate exit status on failure. */ - int cvs_init(int argc, char **argv) { diff --git a/usr.bin/cvs/lock.c b/usr.bin/cvs/lock.c index a0cc720e579..3cd5bf6eb02 100644 --- a/usr.bin/cvs/lock.c +++ b/usr.bin/cvs/lock.c @@ -1,16 +1,16 @@ -/* $OpenBSD: lock.c,v 1.2 2004/08/02 17:32:48 jfb Exp $ */ +/* $OpenBSD: lock.c,v 1.3 2004/12/07 17:10:56 tedu Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> - * All rights reserved. + * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. * 2. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY @@ -21,7 +21,7 @@ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include <sys/types.h> @@ -38,9 +38,6 @@ #include "cvs.h" - - - int cvs_lock(const char *path) { @@ -60,7 +57,5 @@ int cvs_unlock(const char *path) { - - return (0); } diff --git a/usr.bin/cvs/log.c b/usr.bin/cvs/log.c index 720ca205d13..0932ca5162d 100644 --- a/usr.bin/cvs/log.c +++ b/usr.bin/cvs/log.c @@ -1,4 +1,4 @@ -/* $OpenBSD: log.c,v 1.6 2004/12/06 21:03:12 deraadt Exp $ */ +/* $OpenBSD: log.c,v 1.7 2004/12/07 17:10:56 tedu Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -82,7 +82,6 @@ static struct syslog_data cvs_sl; * Initialize the logging facility of the server. * Returns 0 on success, or -1 on failure. */ - int cvs_log_init(u_int dest, u_int flags) { @@ -116,12 +115,11 @@ cvs_log_init(u_int dest, u_int flags) * * Cleanup the logging facility. */ - void cvs_log_cleanup(void) { - closelog_r(&cvs_sl); + closelog_r(&cvs_sl); } @@ -184,7 +182,6 @@ cvs_log_filter(u_int how, u_int level) * The <fmt> argument should not have a terminating newline, as this is taken * care of by the logging facility. */ - int cvs_log(u_int level, const char *fmt, ...) { @@ -205,7 +202,6 @@ cvs_log(u_int level, const char *fmt, ...) * The <fmt> argument should not have a terminating newline, as this is taken * care of by the logging facility. */ - int cvs_vlog(u_int level, const char *fmt, va_list vap) { @@ -286,7 +282,6 @@ cvs_vlog(u_int level, const char *fmt, va_list vap) * Wrapper function around printf() that prepends a 'M' or 'E' command when * the program is acting as server. */ - int cvs_printf(const char *fmt, ...) { diff --git a/usr.bin/cvs/log.h b/usr.bin/cvs/log.h index 21afc300647..79dbebf8b58 100644 --- a/usr.bin/cvs/log.h +++ b/usr.bin/cvs/log.h @@ -1,4 +1,4 @@ -/* $OpenBSD: log.h,v 1.3 2004/08/05 13:39:01 jfb Exp $ */ +/* $OpenBSD: log.h,v 1.4 2004/12/07 17:10:56 tedu Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -42,7 +42,6 @@ #define LF_PID 0x01 /* include PID in messages */ - /* log priority levels */ #define LP_DEBUG 0 #define LP_INFO 1 @@ -54,10 +53,10 @@ #define LP_ALERT 5 #define LP_ERRNO 6 #define LP_ABORT 7 - + #define LP_MAX 7 #define LP_ALL 255 - + /* filtering methods */ #define LP_FILTER_SET 0 /* set a filter */ #define LP_FILTER_UNSET 1 /* remove a filter */ diff --git a/usr.bin/cvs/logmsg.c b/usr.bin/cvs/logmsg.c index 1b727abd9d8..625ecd110af 100644 --- a/usr.bin/cvs/logmsg.c +++ b/usr.bin/cvs/logmsg.c @@ -1,16 +1,16 @@ -/* $OpenBSD: logmsg.c,v 1.6 2004/12/06 21:03:12 deraadt Exp $ */ +/* $OpenBSD: logmsg.c,v 1.7 2004/12/07 17:10:56 tedu Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> - * All rights reserved. + * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. * 2. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY @@ -21,7 +21,7 @@ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include <sys/types.h> @@ -55,7 +55,6 @@ * The returned value must later be free()d. * Returns a pointer to the allocated buffer on success, or NULL on failure. */ - char* cvs_logmsg_open(const char *path) { @@ -92,7 +91,7 @@ cvs_logmsg_open(const char *path) ((lbuf[0] != 'y') && (lbuf[0] != 'n'))) { fprintf(stderr, "invalid input\n"); continue; - } else if (lbuf[0] == 'y') + } else if (lbuf[0] == 'y') break; else if (lbuf[0] == 'n') { cvs_log(LP_ERR, "aborted by user"); @@ -108,9 +107,8 @@ cvs_logmsg_open(const char *path) } bp = cvs_buf_alloc(128, BUF_AUTOEXT); - if (bp == NULL) { + if (bp == NULL) return (NULL); - } /* lcont is used to tell if a buffer returned by fgets is a start * of line or just line continuation because the buffer isn't @@ -146,7 +144,6 @@ cvs_logmsg_open(const char *path) * Returns the message in a dynamically allocated string on success, NULL on * failure. */ - char* cvs_logmsg_get(const char *dir, struct cvs_flist *files) { @@ -252,7 +249,7 @@ cvs_logmsg_get(const char *dir, struct cvs_flist *files) if ((len == 0) || (len > 2)) { fprintf(stderr, "invalid input\n"); continue; - } else if (buf[0] == 'a') { + } else if (buf[0] == 'a') { cvs_log(LP_ERR, "aborted by user"); break; } else if ((buf[0] == '\n') || (buf[0] == 'c')) { @@ -280,7 +277,6 @@ cvs_logmsg_get(const char *dir, struct cvs_flist *files) * cvs_logmsg_send() * */ - int cvs_logmsg_send(struct cvsroot *root, const char *msg) { diff --git a/usr.bin/cvs/msg.c b/usr.bin/cvs/msg.c index 2134b394032..16a263c69df 100644 --- a/usr.bin/cvs/msg.c +++ b/usr.bin/cvs/msg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: msg.c,v 1.5 2004/12/06 21:03:12 deraadt Exp $ */ +/* $OpenBSD: msg.c,v 1.6 2004/12/07 17:10:56 tedu Exp $ */ /* * Copyright (c) 2002 Matthieu Herrb * Copyright (c) 2001 Niels Provos <provos@citi.umich.edu> @@ -37,7 +37,6 @@ * * Pass a file descriptor <fd> to the other endpoint of the socket <sock>. */ - int cvsd_sendfd(int sock, int fd) { @@ -81,7 +80,6 @@ cvsd_sendfd(int sock, int fd) * Receive a file descriptor over the socket <sock>. Returns the descriptor * on success, or -1 on failure. */ - int cvsd_recvfd(int sock) { @@ -129,7 +127,6 @@ cvsd_recvfd(int sock) * <fd>. * Returns 0 on success, or -1 on failure. */ - int cvsd_sendmsg(int fd, u_int type, const void *data, size_t len) { @@ -181,7 +178,6 @@ cvsd_sendmsg(int fd, u_int type, const void *data, size_t len) * Returns 1 if a message was read, 0 if the remote end closed the message * socket and no further messages can be read, or -1 on failure. */ - int cvsd_recvmsg(int fd, u_int *type, void *dst, size_t *len) { diff --git a/usr.bin/cvs/proto.c b/usr.bin/cvs/proto.c index 0b844bec45d..3408afcb1d6 100644 --- a/usr.bin/cvs/proto.c +++ b/usr.bin/cvs/proto.c @@ -1,4 +1,4 @@ -/* $OpenBSD: proto.c,v 1.30 2004/12/06 21:03:12 deraadt Exp $ */ +/* $OpenBSD: proto.c,v 1.31 2004/12/07 17:10:56 tedu Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -66,8 +66,6 @@ #define CVS_REQF_RESP 0x01 - - extern int verbosity; extern int cvs_compress; extern char *cvs_rsh; @@ -76,11 +74,8 @@ extern int cvs_nolog; extern int cvs_readonly; extern int cvs_cmdop; - - static int cvs_initlog (void); - struct cvs_req cvs_requests[] = { { CVS_REQ_DIRECTORY, "Directory", 0 }, { CVS_REQ_MAXDOTDOT, "Max-dotdot", 0 }, @@ -132,7 +127,6 @@ struct cvs_req cvs_requests[] = { { CVS_REQ_CI, "ci", CVS_REQF_RESP }, }; - struct cvs_resp cvs_responses[] = { { CVS_RESP_OK, "ok" }, { CVS_RESP_ERROR, "error" }, @@ -167,7 +161,6 @@ struct cvs_resp cvs_responses[] = { /* hack to receive the remote version without outputting it */ u_int cvs_version_sent = 0; - static char cvs_proto_buf[4096]; /* @@ -192,7 +185,6 @@ static pid_t cvs_subproc_pid; * server. Then, a version request is sent and various global flags are sent. * Returns 0 on success, or -1 on failure. */ - int cvs_connect(struct cvsroot *root) { @@ -352,7 +344,6 @@ cvs_connect(struct cvsroot *root) * * Disconnect from the cvs server. */ - void cvs_disconnect(struct cvsroot *root) { @@ -372,7 +363,6 @@ cvs_disconnect(struct cvsroot *root) * cvs_req_getbyid() * */ - struct cvs_req* cvs_req_getbyid(int reqid) { @@ -381,6 +371,7 @@ cvs_req_getbyid(int reqid) for (i = 0; i < CVS_NBREQ; i++) if (cvs_requests[i].req_id == reqid) return &(cvs_requests[i]); + return (NULL); } @@ -388,7 +379,6 @@ cvs_req_getbyid(int reqid) /* * cvs_req_getbyname() */ - struct cvs_req* cvs_req_getbyname(const char *rname) { @@ -408,7 +398,6 @@ cvs_req_getbyname(const char *rname) * Build a space-separated list of all the requests that this protocol * implementation supports. */ - char* cvs_req_getvalid(void) { @@ -457,7 +446,6 @@ cvs_req_getvalid(void) * cvs_resp_getbyid() * */ - struct cvs_resp* cvs_resp_getbyid(int respid) { @@ -466,6 +454,7 @@ cvs_resp_getbyid(int respid) for (i = 0; i < CVS_NBREQ; i++) if (cvs_responses[i].resp_id == (u_int)respid) return &(cvs_responses[i]); + return (NULL); } @@ -473,7 +462,6 @@ cvs_resp_getbyid(int respid) /* * cvs_resp_getbyname() */ - struct cvs_resp* cvs_resp_getbyname(const char *rname) { @@ -544,7 +532,6 @@ cvs_resp_getvalid(void) * Send the mode and size of a file followed by the file's contents. * Returns 0 on success, or -1 on failure. */ - int cvs_sendfile(struct cvsroot *root, const char *path) { @@ -594,7 +581,6 @@ cvs_sendfile(struct cvsroot *root, const char *path) * create or update the file whose path is <path> with the received * information. */ - BUF* cvs_recvfile(struct cvsroot *root, mode_t *mode) { @@ -653,7 +639,6 @@ cvs_recvfile(struct cvsroot *root, mode_t *mode) * contained in <arg>, which should not be terminated by a newline. * Returns 0 on success, or -1 on failure. */ - int cvs_sendreq(struct cvsroot *root, u_int rid, const char *arg) { @@ -708,7 +693,6 @@ cvs_sendreq(struct cvsroot *root, u_int rid, const char *arg) * non-zero (either an error occured or the end of the response was reached). * Returns the number of handled commands on success, or -1 on failure. */ - int cvs_getresp(struct cvsroot *root) { @@ -754,7 +738,6 @@ cvs_getresp(struct cvsroot *root) * Get a line from the remote end and store it in <lbuf>. The terminating * newline character is stripped from the result. */ - int cvs_getln(struct cvsroot *root, char *lbuf, size_t len) { @@ -794,7 +777,6 @@ cvs_getln(struct cvsroot *root, char *lbuf, size_t len) * contained in <arg>, which should not be terminated by a newline. * Returns 0 on success, or -1 on failure. */ - int cvs_sendresp(u_int rid, const char *arg) { @@ -827,7 +809,6 @@ cvs_sendresp(u_int rid, const char *arg) * * Get a request from the client. */ - int cvs_getreq(void) { @@ -866,7 +847,6 @@ cvs_getreq(void) * without any modifications. * Returns 0 on success, or -1 on failure. */ - int cvs_sendln(struct cvsroot *root, const char *line) { @@ -902,7 +882,6 @@ cvs_sendln(struct cvsroot *root, const char *line) * * Send the first <len> bytes from the buffer <src> to the server. */ - int cvs_sendraw(struct cvsroot *root, const void *src, size_t len) { @@ -928,7 +907,6 @@ cvs_sendraw(struct cvsroot *root, const void *src, size_t len) * * Receive the first <len> bytes from the buffer <src> to the server. */ - ssize_t cvs_recvraw(struct cvsroot *root, void *dst, size_t len) { @@ -954,9 +932,8 @@ cvs_recvraw(struct cvsroot *root, void *dst, size_t len) * * Send a `Directory' request along with the 2 paths that follow it. */ - int -cvs_senddir(struct cvsroot *root, CVSFILE *dir) +cvs_senddir(struct cvsroot *root, CVSFILE *dir) { char lbuf[MAXPATHLEN], rbuf[MAXPATHLEN]; @@ -983,7 +960,6 @@ cvs_senddir(struct cvsroot *root, CVSFILE *dir) * determine if the argument should be simply appended to the last argument * sent or if it should be created as a new argument (0). */ - int cvs_sendarg(struct cvsroot *root, const char *arg, int append) { @@ -998,7 +974,6 @@ cvs_sendarg(struct cvsroot *root, const char *arg, int append) * Send an `Entry' request to the server along with the mandatory fields from * the CVS entry <ent> (which are the name and revision). */ - int cvs_sendentry(struct cvsroot *root, const struct cvs_ent *ent) { @@ -1020,7 +995,6 @@ cvs_sendentry(struct cvsroot *root, const struct cvs_ent *ent) * output. * Returns 0 on success, or -1 on failure. */ - static int cvs_initlog(void) { diff --git a/usr.bin/cvs/proto.h b/usr.bin/cvs/proto.h index b4e54a48b50..90e0e281dbd 100644 --- a/usr.bin/cvs/proto.h +++ b/usr.bin/cvs/proto.h @@ -1,16 +1,16 @@ -/* $OpenBSD: proto.h,v 1.4 2004/08/04 13:26:03 jfb Exp $ */ +/* $OpenBSD: proto.h,v 1.5 2004/12/07 17:10:56 tedu Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> - * All rights reserved. + * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. * 2. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY @@ -21,7 +21,7 @@ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef PROTO_H @@ -35,8 +35,6 @@ #define CVS_PROTO_MAXARG 256 - - #define CVS_REQ_TIMEOUT 300 @@ -163,12 +161,6 @@ struct cvs_resp { }; - - - - - - int cvs_sendfile (struct cvsroot *, const char *); BUF* cvs_recvfile (struct cvsroot *, mode_t *); int cvs_connect (struct cvsroot *); diff --git a/usr.bin/cvs/rcs.c b/usr.bin/cvs/rcs.c index 6a486467188..230f6b09cab 100644 --- a/usr.bin/cvs/rcs.c +++ b/usr.bin/cvs/rcs.c @@ -1,16 +1,16 @@ -/* $OpenBSD: rcs.c,v 1.14 2004/12/06 21:03:12 deraadt Exp $ */ +/* $OpenBSD: rcs.c,v 1.15 2004/12/07 17:10:56 tedu Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> - * All rights reserved. + * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. * 2. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY @@ -21,7 +21,7 @@ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include <sys/param.h> @@ -74,7 +74,6 @@ #define RCS_VOPT 0x02 /* value is optional */ - /* opaque parse data */ struct rcs_pdata { u_int rp_line; @@ -162,7 +161,6 @@ static struct rcs_key { * first operation that requires information from the file. * Returns a handle to the opened file on success, or NULL on failure. */ - RCSFILE* rcs_open(const char *path, u_int mode) { @@ -225,7 +223,6 @@ rcs_open(const char *path, u_int mode) * * Close an RCS file handle. */ - void rcs_close(RCSFILE *rfp) { @@ -283,7 +280,6 @@ rcs_close(RCSFILE *rfp) * path is in <rf_path>. * Returns 0 on success, or -1 on failure. */ - int rcs_write(RCSFILE *rfp) { @@ -377,7 +373,6 @@ rcs_write(RCSFILE *rfp) * is named <sym> and is bound to the RCS revision <snum>. * Returns 0 on success, or -1 on failure. */ - int rcs_addsym(RCSFILE *rfp, const char *sym, RCSNUM *snum) { @@ -947,7 +942,7 @@ rcs_parse_delta(RCSFILE *rfp) rcs_freedelta(rdp); return (-1); } else if (tok == RCS_TOK_NUM || tok == RCS_TOK_DESC) { - rcs_pushtok(rfp, RCS_TOKSTR(rfp), tok); + rcs_pushtok(rfp, RCS_TOKSTR(rfp), tok); ret = (tok == RCS_TOK_NUM ? 1 : 0); break; } @@ -994,7 +989,7 @@ rcs_parse_delta(RCSFILE *rfp) free(tokstr); tokstr = strdup(RCS_TOKSTR(rfp)); if (tokstr == NULL) { - cvs_log(LP_ERRNO, + cvs_log(LP_ERRNO, "failed to duplicate rcs token"); rcs_freedelta(rdp); return (-1); @@ -1488,7 +1483,7 @@ rcs_gettok(RCSFILE *rfp) *bp = '\0'; for (i = 0; i < sizeof(rcs_keys)/sizeof(rcs_keys[0]); i++) { - if (strcmp(rcs_keys[i].rk_str, pdp->rp_buf) == 0) { + if (strcmp(rcs_keys[i].rk_str, pdp->rp_buf) == 0) { type = rcs_keys[i].rk_id; break; } diff --git a/usr.bin/cvs/rcs.h b/usr.bin/cvs/rcs.h index b902ce3e1ef..6cfc273f214 100644 --- a/usr.bin/cvs/rcs.h +++ b/usr.bin/cvs/rcs.h @@ -1,16 +1,16 @@ -/* $OpenBSD: rcs.h,v 1.1 2004/07/13 22:02:40 jfb Exp $ */ +/* $OpenBSD: rcs.h,v 1.2 2004/12/07 17:10:56 tedu Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> - * All rights reserved. + * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. * 2. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY @@ -21,7 +21,7 @@ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef RCS_H @@ -64,7 +64,6 @@ typedef struct rcs_num { } RCSNUM; - struct rcs_sym { char *rs_name; RCSNUM *rs_num; @@ -105,7 +104,6 @@ struct rcs_delta { }; - typedef struct rcs_file { char *rf_path; u_int rf_ref; @@ -126,8 +124,6 @@ typedef struct rcs_file { } RCSFILE; - - RCSFILE* rcs_open (const char *, u_int); void rcs_close (RCSFILE *); int rcs_parse (RCSFILE *); diff --git a/usr.bin/cvs/rcsnum.c b/usr.bin/cvs/rcsnum.c index 2992be817e1..16bad8c8727 100644 --- a/usr.bin/cvs/rcsnum.c +++ b/usr.bin/cvs/rcsnum.c @@ -1,16 +1,16 @@ -/* $OpenBSD: rcsnum.c,v 1.3 2004/07/29 17:47:50 jfb Exp $ */ +/* $OpenBSD: rcsnum.c,v 1.4 2004/12/07 17:10:56 tedu Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> - * All rights reserved. + * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. * 2. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY @@ -21,12 +21,11 @@ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include <sys/param.h> - #include <ctype.h> #include <stdio.h> #include <stdlib.h> @@ -42,7 +41,6 @@ * * Allocate an RCS number structure. */ - RCSNUM* rcsnum_alloc(void) { @@ -79,7 +77,6 @@ rcsnum_free(RCSNUM *rn) * rcsnum_tostr() * Returns a pointer to the start of <buf> on success, or NULL on failure. */ - char* rcsnum_tostr(const RCSNUM *nump, char *buf, size_t blen) { @@ -91,7 +88,7 @@ rcsnum_tostr(const RCSNUM *nump, char *buf, size_t blen) return (buf); } - snprintf(buf, blen, "%u", nump->rn_id[0]); + snprintf(buf, blen, "%u", nump->rn_id[0]); for (i = 1; i < nump->rn_len; i++) { snprintf(tmp, sizeof(tmp), ".%u", nump->rn_id[i]); strlcat(buf, tmp, blen); @@ -108,7 +105,6 @@ rcsnum_tostr(const RCSNUM *nump, char *buf, size_t blen) * numbers deep. * Returns 0 on success, or -1 on failure. */ - int rcsnum_cpy(const RCSNUM *nsrc, RCSNUM *ndst, u_int depth) { @@ -143,7 +139,6 @@ rcsnum_cpy(const RCSNUM *nsrc, RCSNUM *ndst, u_int depth) * the result. A value of 0 means that the depth will be the minimum of the * two numbers. */ - int rcsnum_cmp(const RCSNUM *n1, const RCSNUM *n2, u_int depth) { @@ -154,7 +149,7 @@ rcsnum_cmp(const RCSNUM *n1, const RCSNUM *n2, u_int depth) slen = MIN(n1->rn_len, n2->rn_len); if ((depth != 0) && (slen > depth)) slen = depth; - + for (i = 0; i < slen; i++) { res = n1->rn_id[i] - n2->rn_id[i]; if (res < 0) @@ -181,7 +176,6 @@ rcsnum_cmp(const RCSNUM *n1, const RCSNUM *n2, u_int depth) * NULL. * Returns 0 on success, or -1 on failure. */ - int rcsnum_aton(const char *str, char **ep, RCSNUM *nump) { diff --git a/usr.bin/cvs/req.c b/usr.bin/cvs/req.c index 294ef8adc88..e70ce19dd42 100644 --- a/usr.bin/cvs/req.c +++ b/usr.bin/cvs/req.c @@ -1,4 +1,4 @@ -/* $OpenBSD: req.c,v 1.6 2004/12/06 21:03:12 deraadt Exp $ */ +/* $OpenBSD: req.c,v 1.7 2004/12/07 17:10:56 tedu Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -150,9 +150,6 @@ static char *cvs_req_args[CVS_PROTO_MAXARG]; static int cvs_req_nargs = 0; - - - /* * cvs_req_handle() * @@ -160,7 +157,6 @@ static int cvs_req_nargs = 0; * of the command as single argument. * Returns the return value of the command on success, or -1 on failure. */ - int cvs_req_handle(char *line) { @@ -185,7 +181,6 @@ cvs_req_handle(char *line) } - static int cvs_req_root(int reqid, char *line) { @@ -235,8 +230,6 @@ static int cvs_req_directory(int reqid, char *line) { - - return (0); } @@ -245,7 +238,6 @@ cvs_req_directory(int reqid, char *line) * * Handler for the `Case' requests, which toggles case sensitivity ON or OFF */ - static int cvs_req_case(int reqid, char *line) { diff --git a/usr.bin/cvs/resp.c b/usr.bin/cvs/resp.c index 8f5ad26497d..b491047bc57 100644 --- a/usr.bin/cvs/resp.c +++ b/usr.bin/cvs/resp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: resp.c,v 1.12 2004/12/07 16:48:55 jfb Exp $ */ +/* $OpenBSD: resp.c,v 1.13 2004/12/07 17:10:56 tedu Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -57,7 +57,6 @@ } while (0) - static int cvs_resp_validreq (struct cvsroot *, int, char *); static int cvs_resp_cksum (struct cvsroot *, int, char *); static int cvs_resp_modtime (struct cvsroot *, int, char *); @@ -143,7 +142,6 @@ extern u_int cvs_version_sent; * of the command as single argument. * Returns the return value of the command on success, or -1 on failure. */ - int cvs_resp_handle(struct cvsroot *root, char *line) { @@ -176,7 +174,6 @@ cvs_resp_handle(struct cvsroot *root, char *line) * to 1 to indicate the validity. * Returns 0 on success, or -1 on failure. */ - static int cvs_resp_validreq(struct cvsroot *root, int type, char *line) { @@ -207,7 +204,6 @@ cvs_resp_validreq(struct cvsroot *root, int type, char *line) * * Handler for the `M', 'MT', `F' and `E' responses. */ - static int cvs_resp_m(struct cvsroot *root, int type, char *line) { @@ -285,12 +281,12 @@ cvs_resp_m(struct cvsroot *root, int type, char *line) /* * cvs_resp_ok() * - * Handler for the `ok' response. This handler's job is to + * Handler for the `ok' response. This handler's job is to */ - static int cvs_resp_ok(struct cvsroot *root, int type, char *line) { + return (1); } @@ -298,12 +294,12 @@ cvs_resp_ok(struct cvsroot *root, int type, char *line) /* * cvs_resp_error() * - * Handler for the `error' response. This handler's job is to + * Handler for the `error' response. This handler's job is to */ - static int cvs_resp_error(struct cvsroot *root, int type, char *line) { + fprintf(stderr, "%s\n", line); return (1); } @@ -315,7 +311,6 @@ cvs_resp_error(struct cvsroot *root, int type, char *line) * Handler for the `Clear-static-directory' and `Set-static-directory' * responses. */ - static int cvs_resp_statdir(struct cvsroot *root, int type, char *line) { @@ -355,7 +350,6 @@ cvs_resp_statdir(struct cvsroot *root, int type, char *line) * specified directory doesn't exist, we create it and attach it to the * global file structure. */ - static int cvs_resp_sticky(struct cvsroot *root, int type, char *line) { @@ -416,7 +410,6 @@ cvs_resp_sticky(struct cvsroot *root, int type, char *line) * Handler for the `New-entry' response and `Checked-in' responses. * In the case of `New-entry', we expect the entry line */ - static int cvs_resp_newentry(struct cvsroot *root, int type, char *line) { @@ -470,7 +463,6 @@ cvs_resp_newentry(struct cvsroot *root, int type, char *line) * The file handler must make sure that the checksums match and free the * checksum buffer once it's done to indicate there is no further checksum. */ - static int cvs_resp_cksum(struct cvsroot *root, int type, char *line) { @@ -496,7 +488,6 @@ cvs_resp_cksum(struct cvsroot *root, int type, char *line) * given is used to set the last modification time on the next file that * will be received. */ - static int cvs_resp_modtime(struct cvsroot *root, int type, char *line) { @@ -511,7 +502,6 @@ cvs_resp_modtime(struct cvsroot *root, int type, char *line) * Handler for the `Updated', `Update-existing', `Created', `Merged' and * `Patched' responses, which all have a very similar format. */ - static int cvs_resp_updated(struct cvsroot *root, int type, char *line) { @@ -604,7 +594,6 @@ cvs_resp_updated(struct cvsroot *root, int type, char *line) * the local copy. The `Remove-entry' is received in cases where the file is * already gone but there is still an entry to remove in the Entries file. */ - static int cvs_resp_removed(struct cvsroot *root, int type, char *line) { @@ -636,7 +625,6 @@ cvs_resp_removed(struct cvsroot *root, int type, char *line) * * Handler for the `Mode' response. */ - static int cvs_resp_mode(struct cvsroot *root, int type, char *line) { @@ -653,7 +641,6 @@ cvs_resp_mode(struct cvsroot *root, int type, char *line) * * Handler for the `Module-expansion' response. */ - static int cvs_resp_modxpand(struct cvsroot *root, int type, char *line) { @@ -665,7 +652,6 @@ cvs_resp_modxpand(struct cvsroot *root, int type, char *line) * * Handler for the `Rcs-diff' response. */ - static int cvs_resp_rcsdiff(struct cvsroot *root, int type, char *line) { @@ -686,9 +672,8 @@ cvs_resp_rcsdiff(struct cvsroot *root, int type, char *line) /* get updated entry fields */ cvs_getln(root, buf, sizeof(buf)); ent = cvs_ent_parse(buf); - if (ent == NULL) { + if (ent == NULL) return (-1); - } patchbuf = cvs_recvfile(root, &fmode); fcont = cvs_buf_load(file, BUF_AUTOEXT); @@ -736,7 +721,6 @@ cvs_resp_rcsdiff(struct cvsroot *root, int type, char *line) * * Handler for the `Template' response. */ - static int cvs_resp_template(struct cvsroot *root, int type, char *line) { diff --git a/usr.bin/cvs/root.c b/usr.bin/cvs/root.c index de8d8e14b43..255663448dd 100644 --- a/usr.bin/cvs/root.c +++ b/usr.bin/cvs/root.c @@ -1,16 +1,16 @@ -/* $OpenBSD: root.c,v 1.12 2004/12/06 21:03:13 deraadt Exp $ */ +/* $OpenBSD: root.c,v 1.13 2004/12/07 17:10:56 tedu Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> - * All rights reserved. + * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. * 2. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY @@ -21,7 +21,7 @@ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include <sys/types.h> @@ -81,7 +81,6 @@ static u_int cvs_rcsz = 0; * Returns a pointer to the allocated information on success, or NULL * on failure. */ - struct cvsroot* cvsroot_parse(const char *str) { @@ -229,7 +228,6 @@ cvsroot_parse(const char *str) * Free a CVSROOT structure previously allocated and returned by * cvsroot_parse(). */ - void cvsroot_free(struct cvsroot *root) { @@ -256,7 +254,6 @@ cvsroot_free(struct cvsroot *root) * 2) the CVS/Root file found in checked-out trees * 3) the CVSROOT environment variable */ - struct cvsroot* cvsroot_get(const char *dir) { @@ -290,9 +287,9 @@ cvsroot_get(const char *dir) (void)fclose(fp); len = strlen(line); - if (len == 0) { + if (len == 0) cvs_log(LP_WARN, "empty CVS/Root file"); - } else if (line[len - 1] == '\n') + else if (line[len - 1] == '\n') line[--len] = '\0'; return cvsroot_parse(line); diff --git a/usr.bin/cvs/server.c b/usr.bin/cvs/server.c index f1a60d969d4..c475a12c595 100644 --- a/usr.bin/cvs/server.c +++ b/usr.bin/cvs/server.c @@ -1,16 +1,16 @@ -/* $OpenBSD: server.c,v 1.5 2004/08/02 17:35:37 jfb Exp $ */ +/* $OpenBSD: server.c,v 1.6 2004/12/07 17:10:56 tedu Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> - * All rights reserved. + * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. * 2. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY @@ -21,7 +21,7 @@ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include <sys/types.h> @@ -40,16 +40,12 @@ #include "proto.h" - /* argument vector built by the `Argument' and `Argumentx' requests */ char **cvs_args; -u_int cvs_nbarg = 0; - +u_int cvs_nbarg = 0; u_int cvs_utf8ok = 0; u_int cvs_case = 0; - - /* * cvs_server() * @@ -61,7 +57,6 @@ u_int cvs_case = 0; * cvs command. With this command, the cvs program starts listening on * standard input for CVS protocol requests. */ - int cvs_server(int argc, char **argv) { diff --git a/usr.bin/cvs/session.c b/usr.bin/cvs/session.c index bbea8df56f3..b5586a0d282 100644 --- a/usr.bin/cvs/session.c +++ b/usr.bin/cvs/session.c @@ -1,16 +1,16 @@ -/* $OpenBSD: session.c,v 1.1 2004/11/09 20:50:27 krapht Exp $ */ +/* $OpenBSD: session.c,v 1.2 2004/12/07 17:10:56 tedu Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> - * All rights reserved. + * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. * 2. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY @@ -21,7 +21,7 @@ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include <sys/param.h> @@ -55,7 +55,6 @@ * * Allocate a new session. */ - struct cvsd_sess* cvsd_sess_alloc(int fd) { @@ -90,11 +89,10 @@ cvsd_sess_alloc(int fd) * cvsd_sess_free() * */ - void cvsd_sess_free(struct cvsd_sess *sessp) { - if (sessp != NULL) { + + if (sessp != NULL) free(sessp); - } } diff --git a/usr.bin/cvs/sock.c b/usr.bin/cvs/sock.c index acabab1b530..a95bec0ea5c 100644 --- a/usr.bin/cvs/sock.c +++ b/usr.bin/cvs/sock.c @@ -1,16 +1,16 @@ -/* $OpenBSD: sock.c,v 1.7 2004/11/09 20:43:22 krapht Exp $ */ +/* $OpenBSD: sock.c,v 1.8 2004/12/07 17:10:56 tedu Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> - * All rights reserved. + * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. * 2. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY @@ -21,7 +21,7 @@ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include <sys/types.h> @@ -46,8 +46,6 @@ volatile sig_atomic_t cvs_sock_doloop; char *cvsd_sock_path = CVSD_SOCK_PATH; - - /* daemon API */ #ifdef CVSD int cvsd_sock = -1; @@ -69,7 +67,6 @@ static struct sockaddr_un cvs_sun; * we close it before reopening it. * Returns 0 on success, -1 on failure. */ - int cvsd_sock_open(void) { @@ -81,7 +78,7 @@ cvsd_sock_open(void) cvsd_sock = socket(AF_LOCAL, SOCK_STREAM, 0); if (cvsd_sock == -1) { - cvs_log(LP_ERRNO, "failed to open socket"); + cvs_log(LP_ERRNO, "failed to open socket"); return (-1); } @@ -122,7 +119,6 @@ cvsd_sock_open(void) * * Close the local socket. */ - void cvsd_sock_close(void) { @@ -147,7 +143,6 @@ cvsd_sock_close(void) * no available child processes, a new one will be created unless the number * of children has attained the maximum. */ - int cvsd_sock_accept(int fd) { @@ -172,7 +167,6 @@ cvsd_sock_accept(int fd) * * Open a connection to the CVS server's local socket. */ - int cvs_sock_connect(const char *path) { @@ -205,7 +199,6 @@ cvs_sock_connect(const char *path) * * Disconnect from the open socket to the CVS server. */ - void cvs_sock_disconnect(void) { diff --git a/usr.bin/cvs/sock.h b/usr.bin/cvs/sock.h index e4eb972810c..9cdff5114c2 100644 --- a/usr.bin/cvs/sock.h +++ b/usr.bin/cvs/sock.h @@ -1,16 +1,16 @@ -/* $OpenBSD: sock.h,v 1.2 2004/07/25 03:31:25 jfb Exp $ */ +/* $OpenBSD: sock.h,v 1.3 2004/12/07 17:10:56 tedu Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> - * All rights reserved. + * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. * 2. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY @@ -21,7 +21,7 @@ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef SOCK_H diff --git a/usr.bin/cvs/status.c b/usr.bin/cvs/status.c index 7c1d2db3438..f36cf73c675 100644 --- a/usr.bin/cvs/status.c +++ b/usr.bin/cvs/status.c @@ -1,16 +1,16 @@ -/* $OpenBSD: status.c,v 1.3 2004/12/06 21:03:13 deraadt Exp $ */ +/* $OpenBSD: status.c,v 1.4 2004/12/07 17:10:56 tedu Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> - * All rights reserved. + * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. * 2. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY @@ -21,7 +21,7 @@ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include <sys/types.h> @@ -54,15 +54,12 @@ const char *cvs_statstr[] = { int cvs_status_file (CVSFILE *, void *); - - /* * cvs_status() * * Handler for the `cvs status' command. * Returns 0 on success, or one of the known exit codes on error. */ - int cvs_status(int argc, char **argv) { @@ -104,7 +101,6 @@ cvs_status(int argc, char **argv) * * Get the status of a single file. */ - int cvs_status_file(CVSFILE *cfp, void *arg) { @@ -129,11 +125,10 @@ cvs_status_file(CVSFILE *cfp, void *arg) root = cfp->cf_parent->cf_ddat->cd_root; rf = NULL; - if (cfp->cf_parent != NULL) { + if (cfp->cf_parent != NULL) repo = cfp->cf_parent->cf_ddat->cd_repo; - } else { + else repo = NULL; - } if (cfp->cf_cvstat == CVS_FST_UNKNOWN) { if (root->cr_method == CVS_METHOD_LOCAL) diff --git a/usr.bin/cvs/update.c b/usr.bin/cvs/update.c index 6e6c6413e0b..76420c3d2d5 100644 --- a/usr.bin/cvs/update.c +++ b/usr.bin/cvs/update.c @@ -1,16 +1,16 @@ -/* $OpenBSD: update.c,v 1.10 2004/12/06 21:03:13 deraadt Exp $ */ +/* $OpenBSD: update.c,v 1.11 2004/12/07 17:10:56 tedu Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> - * All rights reserved. + * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. * 2. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY @@ -21,7 +21,7 @@ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include <sys/param.h> @@ -45,15 +45,12 @@ int cvs_update_file (CVSFILE *, void *); int cvs_update_prune (CVSFILE *, void *); - - /* * cvs_update() * * Handle the `cvs update' command. * Returns 0 on success, or the appropriate exit code on error. */ - int cvs_update(int argc, char **argv) { @@ -114,7 +111,6 @@ cvs_update(int argc, char **argv) * * Diff a single file. */ - int cvs_update_file(CVSFILE *cf, void *arg) { @@ -207,7 +203,6 @@ cvs_update_file(CVSFILE *cf, void *arg) * * Prune all directories which contain no more files known to CVS. */ - int cvs_update_prune(CVSFILE *cf, void *arg) { diff --git a/usr.bin/cvs/util.c b/usr.bin/cvs/util.c index 2ad2823dd87..8893026bd85 100644 --- a/usr.bin/cvs/util.c +++ b/usr.bin/cvs/util.c @@ -1,4 +1,4 @@ -/* $OpenBSD: util.c,v 1.17 2004/12/07 06:33:11 jfb Exp $ */ +/* $OpenBSD: util.c,v 1.18 2004/12/07 17:10:56 tedu Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -81,7 +81,6 @@ static const char *cvs_modestr[8] = { }; - pid_t cvs_exec_pid; @@ -92,7 +91,6 @@ pid_t cvs_exec_pid; * <dir>, and store that path into the buffer pointed to by <dst>, whose size * is <len>. */ - int cvs_readrepo(const char *dir, char *dst, size_t len) { @@ -132,7 +130,6 @@ cvs_readrepo(const char *dir, char *dst, size_t len) * parameter is not 0, the returned time will be adjusted according to the * machine's local timezone. */ - time_t cvs_datesec(const char *date, int type, int adj) { @@ -184,7 +181,7 @@ cvs_datesec(const char *date, int type, int adj) &cvs_tm.tm_mday, &cvs_tm.tm_hour, &cvs_tm.tm_min, &cvs_tm.tm_sec, &cvs_tm.tm_year); cvs_tm.tm_year -= 1900; - cvs_tm.tm_gmtoff = 0; + cvs_tm.tm_gmtoff = 0; } for (i = 0; i < (int)(sizeof(cvs_months)/sizeof(cvs_months[0])); i++) { @@ -208,7 +205,6 @@ cvs_datesec(const char *date, int type, int adj) * an error in such cases, but will issue warnings. * Returns 0 on success, or -1 on failure. */ - int cvs_strtomode(const char *str, mode_t *mode) { @@ -265,7 +261,6 @@ cvs_strtomode(const char *str, mode_t *mode) * * Returns 0 on success, or -1 on failure. */ - int cvs_modetostr(mode_t mode, char *buf, size_t len) { @@ -310,7 +305,6 @@ cvs_modetostr(mode_t mode, char *buf, size_t len) * given in <len> and must be at least 33. * Returns 0 on success, or -1 on failure. */ - int cvs_cksum(const char *file, char *dst, size_t len) { @@ -336,7 +330,6 @@ cvs_cksum(const char *file, char *dst, size_t len) * that delimiter. * Returns 0 on success, or -1 on failure. */ - int cvs_splitpath(const char *path, char *base, size_t blen, char **file) { @@ -372,7 +365,6 @@ cvs_splitpath(const char *path, char *base, size_t blen, char **file) * <argv>, which can accept up to <argvlen> entries. * Returns the number of arguments in the vector, or -1 if an error occured. */ - int cvs_getargv(const char *line, char **argv, int argvlen) { @@ -482,7 +474,6 @@ cvs_makeargv(const char *line, int *argc) * * Free an argument vector previously generated by cvs_getargv(). */ - void cvs_freeargv(char **argv, int argc) { @@ -501,7 +492,6 @@ cvs_freeargv(char **argv, int argc) * files already exist, they are kept as is. * Returns 0 on success, or -1 on failure. */ - int cvs_mkadmin(CVSFILE *cdir, mode_t mode) { @@ -569,7 +559,6 @@ cvs_mkadmin(CVSFILE *cdir, mode_t mode) /* * cvs_exec() */ - int cvs_exec(int argc, char **argv, int fds[3]) { diff --git a/usr.bin/cvs/version.c b/usr.bin/cvs/version.c index 24a07f53f94..eede8d1cc1c 100644 --- a/usr.bin/cvs/version.c +++ b/usr.bin/cvs/version.c @@ -1,16 +1,16 @@ -/* $OpenBSD: version.c,v 1.6 2004/08/27 15:39:22 jfb Exp $ */ +/* $OpenBSD: version.c,v 1.7 2004/12/07 17:10:56 tedu Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> - * All rights reserved. + * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. * 2. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY @@ -21,7 +21,7 @@ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include <sys/types.h> |