diff options
author | Sebastian Benoit <benno@cvs.openbsd.org> | 2019-02-12 19:39:58 +0000 |
---|---|---|
committer | Sebastian Benoit <benno@cvs.openbsd.org> | 2019-02-12 19:39:58 +0000 |
commit | d9a2113ba9895f5aa64f74273ac24ab0807ea0fe (patch) | |
tree | acd564ff017d7ec27a9b87c0a84d7d7f031f3444 /usr.bin | |
parent | 05051ed357dd3e0558c7e9dcb47fda476b1a7e09 (diff) |
whitespace and knf
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/rsync/downloader.c | 4 | ||||
-rw-r--r-- | usr.bin/rsync/extern.h | 7 | ||||
-rw-r--r-- | usr.bin/rsync/fargs.c | 4 | ||||
-rw-r--r-- | usr.bin/rsync/flist.c | 6 | ||||
-rw-r--r-- | usr.bin/rsync/ids.c | 16 | ||||
-rw-r--r-- | usr.bin/rsync/main.c | 7 |
6 files changed, 23 insertions, 21 deletions
diff --git a/usr.bin/rsync/downloader.c b/usr.bin/rsync/downloader.c index b2bb0dd35e2..749978f8b10 100644 --- a/usr.bin/rsync/downloader.c +++ b/usr.bin/rsync/downloader.c @@ -1,4 +1,4 @@ -/* $Id: downloader.c,v 1.6 2019/02/12 19:13:59 benno Exp $ */ +/* $Id: downloader.c,v 1.7 2019/02/12 19:39:57 benno Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -568,7 +568,7 @@ rsync_downloader(struct download *p, struct sess *sess, int *ofd) goto out; } - /* + /* * Conditionally adjust group id. * FIXME: remember the original file's group id and don't * reassign it if it's the same. diff --git a/usr.bin/rsync/extern.h b/usr.bin/rsync/extern.h index 72d59a14d62..3c2a78dc7cb 100644 --- a/usr.bin/rsync/extern.h +++ b/usr.bin/rsync/extern.h @@ -1,4 +1,4 @@ -/* $Id: extern.h,v 1.7 2019/02/12 19:13:03 benno Exp $ */ +/* $Id: extern.h,v 1.8 2019/02/12 19:39:57 benno Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -302,10 +302,11 @@ int sess_stats_send(struct sess *, int); int sess_stats_recv(struct sess *, int); void idents_free(struct ident *, size_t); -void idents_gid_assign(struct sess *, +void idents_gid_assign(struct sess *, struct flist *, size_t, const struct ident *, size_t); void idents_gid_remap(struct sess *, struct ident *, size_t); -int idents_gid_add(struct sess *, struct ident **, size_t *, gid_t); +int idents_gid_add(struct sess *, struct ident **, size_t *, + gid_t); int idents_recv(struct sess *, int, struct ident **, size_t *); int idents_send(struct sess *, int, const struct ident *, size_t); diff --git a/usr.bin/rsync/fargs.c b/usr.bin/rsync/fargs.c index b31c1ec50b7..d1fbd844614 100644 --- a/usr.bin/rsync/fargs.c +++ b/usr.bin/rsync/fargs.c @@ -1,4 +1,4 @@ -/* $Id: fargs.c,v 1.7 2019/02/12 18:06:25 benno Exp $ */ +/* $Id: fargs.c,v 1.8 2019/02/12 19:39:57 benno Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -56,7 +56,7 @@ fargs_cmdline(struct sess *sess, const struct fargs *f) if (f->host != NULL) { assert(f->host != NULL); - + args[i++] = ssh_prog; args[i++] = f->host; args[i++] = rsync_path; diff --git a/usr.bin/rsync/flist.c b/usr.bin/rsync/flist.c index 894047e346b..e207f90208b 100644 --- a/usr.bin/rsync/flist.c +++ b/usr.bin/rsync/flist.c @@ -1,4 +1,4 @@ -/* $Id: flist.c,v 1.11 2019/02/12 19:33:59 benno Exp $ */ +/* $Id: flist.c,v 1.12 2019/02/12 19:39:57 benno Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -315,7 +315,7 @@ flist_send(struct sess *sess, int fdin, int fdout, const struct flist *fl, if (!io_write_int(sess, fdout, f->st.gid)) { ERRX1(sess, "io_write_int"); goto out; - } + } if (!idents_gid_add(sess, &gids, &gidsz, f->st.gid)) { ERRX1(sess, "idents_gid_add"); goto out; @@ -655,7 +655,7 @@ flist_recv(struct sess *sess, int fd, struct flist **flp, size_t *sz) sess->total_size += ff->st.size; } - /* + /* * Now conditionally read the group list. * We then remap all group identifiers to the local ids. */ diff --git a/usr.bin/rsync/ids.c b/usr.bin/rsync/ids.c index 2ccb4cb9808..fa68b9c132e 100644 --- a/usr.bin/rsync/ids.c +++ b/usr.bin/rsync/ids.c @@ -1,4 +1,4 @@ -/* $Id: ids.c,v 1.3 2019/02/12 19:13:03 benno Exp $ */ +/* $Id: ids.c,v 1.4 2019/02/12 19:39:57 benno Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -77,13 +77,13 @@ idents_gid_assign(struct sess *sess, struct flist *fl, size_t flsz, void idents_gid_remap(struct sess *sess, struct ident *gids, size_t gidsz) { - size_t i; + size_t i; struct group *grp; for (i = 0; i < gidsz; i++) { assert(gids[i].id != 0); - /* + /* * (1) Empty names inherit. * (2) Unknown group names inherit. * (3) Group wheel inherits. @@ -124,7 +124,7 @@ idents_gid_add(struct sess *sess, struct ident **gids, size_t *gidsz, gid_t gid) if ((*gids)[i].id == (int32_t)gid) return 1; - /* + /* * Look us up in /etc/group. * Make sure that the group name length is sane: we transmit it * using a single byte. @@ -157,7 +157,7 @@ idents_gid_add(struct sess *sess, struct ident **gids, size_t *gidsz, gid_t gid) return 0; } - LOG4(sess, "adding group to list: %s (%u)", + LOG4(sess, "adding group to list: %s (%u)", (*gids)[*gidsz].name, (*gids)[*gidsz].id); (*gidsz)++; return 1; @@ -170,7 +170,7 @@ idents_gid_add(struct sess *sess, struct ident **gids, size_t *gidsz, gid_t gid) * Return zero on failure, non-zero on success. */ int -idents_send(struct sess *sess, +idents_send(struct sess *sess, int fd, const struct ident *ids, size_t idsz) { size_t i, sz; @@ -220,8 +220,8 @@ idents_recv(struct sess *sess, return 0; } else if (id == 0) break; - - pp = reallocarray(*ids, + + pp = reallocarray(*ids, *idsz + 1, sizeof(struct ident)); if (pp == NULL) { ERR(sess, "reallocarray"); diff --git a/usr.bin/rsync/main.c b/usr.bin/rsync/main.c index 9d861782c7c..815987d8602 100644 --- a/usr.bin/rsync/main.c +++ b/usr.bin/rsync/main.c @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.10 2019/02/12 17:58:35 benno Exp $ */ +/* $Id: main.c,v 1.11 2019/02/12 19:39:57 benno Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -244,7 +244,7 @@ fargs_parse(size_t argc, char *argv[]) /* rsync://path */ cp += 8; if (strncmp(cp, f->host, len) || - (cp[len] != '/' && cp[len] != '\0')) + (cp[len] != '/' && cp[len] != '\0')) errx(EXIT_FAILURE, "different remote " "host: %s", f->sources[i]); memmove(f->sources[i], @@ -260,7 +260,8 @@ fargs_parse(size_t argc, char *argv[]) (cp[len] != ':' && cp[len] != '\0')) errx(EXIT_FAILURE, "different remote " "host: %s", f->sources[i]); - memmove(f->sources[i], f->sources[i] + len + 2, j - len - 1); + memmove(f->sources[i], f->sources[i] + len + 2, + j - len - 1); } else if (cp[0] == ':') { /* :path */ memmove(f->sources[i], f->sources[i] + 1, j); |