From f6eb97002d75cdea51fa139084ca80df65ed47b2 Mon Sep 17 00:00:00 2001 From: deraadt Date: Wed, 3 Nov 2021 14:42:12 +0000 Subject: [PATCH] whitespace observed during a read-through --- usr.bin/rsync/blocks.c | 16 ++++++++-------- usr.bin/rsync/fargs.c | 6 +++--- usr.bin/rsync/flist.c | 8 ++++---- usr.bin/rsync/main.c | 8 ++++---- usr.bin/rsync/rules.c | 16 ++++++++-------- usr.bin/rsync/server.c | 4 ++-- usr.bin/rsync/uploader.c | 20 ++++++++++---------- 7 files changed, 39 insertions(+), 39 deletions(-) diff --git a/usr.bin/rsync/blocks.c b/usr.bin/rsync/blocks.c index 81874c8cba0..56790729f27 100644 --- a/usr.bin/rsync/blocks.c +++ b/usr.bin/rsync/blocks.c @@ -1,4 +1,4 @@ -/* $OpenBSD: blocks.c,v 1.20 2021/06/30 13:10:04 claudio Exp $ */ +/* $OpenBSD: blocks.c,v 1.21 2021/11/03 14:42:12 deraadt Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons * @@ -331,10 +331,10 @@ blk_recv_ack(char buf[20], const struct blkset *blocks, int32_t idx) size_t pos = 0, sz; sz = sizeof(int32_t) + /* index */ - sizeof(int32_t) + /* block count */ - sizeof(int32_t) + /* block length */ - sizeof(int32_t) + /* checksum length */ - sizeof(int32_t); /* block remainder */ + sizeof(int32_t) + /* block count */ + sizeof(int32_t) + /* block length */ + sizeof(int32_t) + /* checksum length */ + sizeof(int32_t); /* block remainder */ assert(sz == 20); io_buffer_int(buf, &pos, sz, idx); @@ -457,9 +457,9 @@ blk_send_ack(struct sess *sess, int fd, struct blkset *p) /* Put the entire send routine into a buffer. */ sz = sizeof(int32_t) + /* block count */ - sizeof(int32_t) + /* block length */ - sizeof(int32_t) + /* checksum length */ - sizeof(int32_t); /* block remainder */ + sizeof(int32_t) + /* block length */ + sizeof(int32_t) + /* checksum length */ + sizeof(int32_t); /* block remainder */ assert(sz <= sizeof(buf)); if (!io_read_buf(sess, fd, buf, sz)) { diff --git a/usr.bin/rsync/fargs.c b/usr.bin/rsync/fargs.c index 437ec61ce04..2d3e36866d0 100644 --- a/usr.bin/rsync/fargs.c +++ b/usr.bin/rsync/fargs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fargs.c,v 1.21 2021/10/29 08:00:59 claudio Exp $ */ +/* $OpenBSD: fargs.c,v 1.22 2021/11/03 14:42:12 deraadt Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons * @@ -29,7 +29,7 @@ const char * alt_base_mode(int mode) { - switch(mode) { + switch (mode) { case BASE_MODE_COMPARE: return "--compare-dest"; case BASE_MODE_COPY: @@ -137,7 +137,7 @@ fargs_cmdline(struct sess *sess, const struct fargs *f, size_t *skip) addargs(&args, "--min-size=%lld", sess->opts->min_size); /* only add --compare-dest, etc if this is the sender */ - if (sess->opts->alt_base_mode != 0 && + if (sess->opts->alt_base_mode != 0 && f->mode == FARGS_SENDER) { for (j = 0; j < MAX_BASEDIR; j++) { if (sess->opts->basedir[j] == NULL) diff --git a/usr.bin/rsync/flist.c b/usr.bin/rsync/flist.c index ed3ccb6f470..8fb56a3ea21 100644 --- a/usr.bin/rsync/flist.c +++ b/usr.bin/rsync/flist.c @@ -1,4 +1,4 @@ -/* $OpenBSD: flist.c,v 1.35 2021/10/22 09:59:35 claudio Exp $ */ +/* $OpenBSD: flist.c,v 1.36 2021/11/03 14:42:12 deraadt Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons * Copyright (c) 2019 Florian Obser @@ -283,7 +283,7 @@ flist_send(struct sess *sess, int fdin, int fdout, const struct flist *fl, if (sess->mplex_reads && io_read_check(fdin) && - !io_read_flush(sess, fdin)) { + !io_read_flush(sess, fdin)) { ERRX1("io_read_flush"); goto out; } @@ -356,7 +356,7 @@ flist_send(struct sess *sess, int fdin, int fdout, const struct flist *fl, /* Conditional part: devices & special files. */ if ((sess->opts->devices && (S_ISBLK(f->st.mode) || - S_ISCHR(f->st.mode))) || + S_ISCHR(f->st.mode))) || (sess->opts->specials && (S_ISFIFO(f->st.mode) || S_ISSOCK(f->st.mode)))) { if (!io_write_int(sess, fdout, f->st.rdev)) { @@ -694,7 +694,7 @@ flist_recv(struct sess *sess, int fd, struct flist **flp, size_t *sz) /* Conditional part: devices & special files. */ if ((sess->opts->devices && (S_ISBLK(ff->st.mode) || - S_ISCHR(ff->st.mode))) || + S_ISCHR(ff->st.mode))) || (sess->opts->specials && (S_ISFIFO(ff->st.mode) || S_ISSOCK(ff->st.mode)))) { if (!(FLIST_RDEV_SAME & flag)) { diff --git a/usr.bin/rsync/main.c b/usr.bin/rsync/main.c index d1214a4d25f..e7713cc548a 100644 --- a/usr.bin/rsync/main.c +++ b/usr.bin/rsync/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.62 2021/10/29 08:00:59 claudio Exp $ */ +/* $OpenBSD: main.c,v 1.63 2021/11/03 14:42:12 deraadt Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons * @@ -301,12 +301,12 @@ const struct option lopts[] = { { "devices", no_argument, &opts.devices, 1 }, { "no-devices", no_argument, &opts.devices, 0 }, { "dry-run", no_argument, &opts.dry_run, 1 }, - { "exclude", required_argument, NULL, OP_EXCLUDE }, + { "exclude", required_argument, NULL, OP_EXCLUDE }, { "exclude-from", required_argument, NULL, OP_EXCLUDE_FROM }, { "group", no_argument, &opts.preserve_gids, 1 }, { "no-group", no_argument, &opts.preserve_gids, 0 }, { "help", no_argument, NULL, 'h' }, - { "include", required_argument, NULL, OP_INCLUDE }, + { "include", required_argument, NULL, OP_INCLUDE }, { "include-from", required_argument, NULL, OP_INCLUDE_FROM }, { "links", no_argument, &opts.preserve_links, 1 }, { "max-size", required_argument, NULL, OP_MAX_SIZE }, @@ -345,7 +345,7 @@ main(int argc, char *argv[]) struct sess sess; struct fargs *fargs; char **args; - const char *errstr; + const char *errstr; /* Global pledge. */ diff --git a/usr.bin/rsync/rules.c b/usr.bin/rsync/rules.c index ce01c111eaf..3aab0bddbc0 100644 --- a/usr.bin/rsync/rules.c +++ b/usr.bin/rsync/rules.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rules.c,v 1.3 2021/11/03 08:30:14 claudio Exp $ */ +/* $OpenBSD: rules.c,v 1.4 2021/11/03 14:42:12 deraadt Exp $ */ /* * Copyright (c) 2021 Claudio Jeker * @@ -23,9 +23,9 @@ struct rule { char *pattern; - enum rule_type type; + enum rule_type type; #ifdef NOTYET - unsigned int modifiers; + unsigned int modifiers; #endif short numseg; unsigned char anchored; @@ -126,7 +126,7 @@ parse_command(const char *command, size_t len) { const char *mod; size_t i; - + mod = memchr(command, ',', len); if (mod != NULL) { /* XXX modifiers not yet implemented */ @@ -179,7 +179,7 @@ parse_pattern(struct rule *r, char *pattern) nseg++; r->numseg = nseg; - /* check if this pattern only matches against the basename */ + /* check if this pattern only matches against the basename */ if (nseg == 1 && !r->anchored) r->fileonly = 1; @@ -221,7 +221,7 @@ parse_rule(char *line, enum rule_type def) return -1; type = def; pattern = line; - } else + } else pattern = line + len + 1; if (*pattern == '\0' && type != RULE_CLEAR) @@ -412,12 +412,12 @@ rules_match(const char *path, int isdir) struct rule *r; size_t i; - basename = strrchr(path, '/'); + basename = strrchr(path, '/'); if (basename != NULL) basename += 1; else basename = path; - + for (i = 0; i < numrules; i++) { r = &rules[i]; diff --git a/usr.bin/rsync/server.c b/usr.bin/rsync/server.c index 9ca46261028..15453a6c90c 100644 --- a/usr.bin/rsync/server.c +++ b/usr.bin/rsync/server.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server.c,v 1.14 2021/06/30 13:10:04 claudio Exp $ */ +/* $OpenBSD: server.c,v 1.15 2021/11/03 14:42:12 deraadt Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons * @@ -65,7 +65,7 @@ rsync_server(const struct opts *opts, size_t argc, char *argv[]) /* Begin by making descriptors non-blocking. */ if (!fcntl_nonblock(fdin) || - !fcntl_nonblock(fdout)) { + !fcntl_nonblock(fdout)) { ERRX1("fcntl_nonblock"); goto out; } diff --git a/usr.bin/rsync/uploader.c b/usr.bin/rsync/uploader.c index 38d1ebdbe89..678b6c96218 100644 --- a/usr.bin/rsync/uploader.c +++ b/usr.bin/rsync/uploader.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uploader.c,v 1.32 2021/10/29 08:00:59 claudio Exp $ */ +/* $OpenBSD: uploader.c,v 1.33 2021/11/03 14:42:12 deraadt Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons * Copyright (c) 2019 Florian Obser @@ -653,7 +653,7 @@ post_dir(struct sess *sess, const struct upload *u, size_t idx) */ static int check_file(int rootfd, const struct flist *f, struct stat *st) -{ +{ if (fstatat(rootfd, f->path, st, AT_SYMLINK_NOFOLLOW) == -1) { if (errno == ENOENT) return 3; @@ -1035,14 +1035,14 @@ rsync_uploader(struct upload *u, int *fileinfd, /* Make sure the block metadata buffer is big enough. */ u->bufsz = - sizeof(int32_t) + /* identifier */ - sizeof(int32_t) + /* block count */ - sizeof(int32_t) + /* block length */ - sizeof(int32_t) + /* checksum length */ - sizeof(int32_t) + /* block remainder */ - blk.blksz * - (sizeof(int32_t) + /* short checksum */ - blk.csum); /* long checksum */ + sizeof(int32_t) + /* identifier */ + sizeof(int32_t) + /* block count */ + sizeof(int32_t) + /* block length */ + sizeof(int32_t) + /* checksum length */ + sizeof(int32_t) + /* block remainder */ + blk.blksz * + (sizeof(int32_t) + /* short checksum */ + blk.csum); /* long checksum */ if (u->bufsz > u->bufmax) { if ((bufp = realloc(u->buf, u->bufsz)) == NULL) { -- 2.20.1