diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2019-03-23 16:04:29 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2019-03-23 16:04:29 +0000 |
commit | 5745778ca1a0122eed5f9e03284d14be92383ace (patch) | |
tree | 1372fe03ea6b687c778c65c138e56548edac6f1c /usr.bin | |
parent | effc5ed450886188cc6834e83e36d7d6eb743998 (diff) |
indents and reflows around ERR*() and LOG*(); ok benno
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/rsync/blocks.c | 49 | ||||
-rw-r--r-- | usr.bin/rsync/client.c | 7 | ||||
-rw-r--r-- | usr.bin/rsync/downloader.c | 10 | ||||
-rw-r--r-- | usr.bin/rsync/flist.c | 25 | ||||
-rw-r--r-- | usr.bin/rsync/ids.c | 19 | ||||
-rw-r--r-- | usr.bin/rsync/main.c | 38 | ||||
-rw-r--r-- | usr.bin/rsync/receiver.c | 11 | ||||
-rw-r--r-- | usr.bin/rsync/sender.c | 17 | ||||
-rw-r--r-- | usr.bin/rsync/server.c | 16 | ||||
-rw-r--r-- | usr.bin/rsync/session.c | 12 | ||||
-rw-r--r-- | usr.bin/rsync/socket.c | 14 | ||||
-rw-r--r-- | usr.bin/rsync/uploader.c | 12 |
12 files changed, 105 insertions, 125 deletions
diff --git a/usr.bin/rsync/blocks.c b/usr.bin/rsync/blocks.c index df2a4321c12..d02f4f40b4b 100644 --- a/usr.bin/rsync/blocks.c +++ b/usr.bin/rsync/blocks.c @@ -1,4 +1,4 @@ -/* $Id: blocks.c,v 1.13 2019/02/18 22:47:34 benno Exp $ */ +/* $Id: blocks.c,v 1.14 2019/03/23 16:04:28 deraadt Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -69,11 +69,11 @@ blk_find(struct sess *sess, const void *buf, off_t size, off_t offs, have_md = 1; if (memcmp(md, blks->blks[hint].chksum_long, blks->csum) == 0) { LOG4(sess, "%s: found matching hinted match: " - "position %jd, block %zu " - "(position %jd, size %zu)", path, - (intmax_t)offs, blks->blks[hint].idx, - (intmax_t)blks->blks[hint].offs, - blks->blks[hint].len); + "position %jd, block %zu (position %jd, size %zu)", + path, + (intmax_t)offs, blks->blks[hint].idx, + (intmax_t)blks->blks[hint].offs, + blks->blks[hint].len); return &blks->blks[hint]; } } @@ -90,11 +90,11 @@ blk_find(struct sess *sess, const void *buf, off_t size, off_t offs, continue; LOG4(sess, "%s: found matching fast match: " - "position %jd, block %zu " - "(position %jd, size %zu)", path, - (intmax_t)offs, blks->blks[i].idx, - (intmax_t)blks->blks[i].offs, - blks->blks[i].len); + "position %jd, block %zu (position %jd, size %zu)", + path, + (intmax_t)offs, blks->blks[i].idx, + (intmax_t)blks->blks[i].offs, + blks->blks[i].len); /* Compute slow hash on demand. */ @@ -155,9 +155,10 @@ blk_match(struct sess *sess, const struct blkset *blks, sz = st->offs - last; st->dirty += sz; st->total += sz; - LOG4(sess, "%s: flushing %jd B before %zu B " - "block %zu", path, (intmax_t)sz, - blk->len, blk->idx); + LOG4(sess, + "%s: flushing %jd B before %zu B block %zu", + path, (intmax_t)sz, + blk->len, blk->idx); tok = -(blk->idx + 1); /* @@ -180,7 +181,7 @@ blk_match(struct sess *sess, const struct blkset *blks, sz = st->mapsz - last; LOG4(sess, "%s: flushing remaining %jd B", - path, (intmax_t)sz); + path, (intmax_t)sz); st->total += sz; st->dirty += sz; @@ -196,7 +197,7 @@ blk_match(struct sess *sess, const struct blkset *blks, st->dirty = st->total = st->mapsz; LOG4(sess, "%s: flushing whole file %zu B", - path, st->mapsz); + path, st->mapsz); } } @@ -269,8 +270,8 @@ blk_recv(struct sess *sess, int fd, const char *path) } LOG3(sess, "%s: read block prologue: %zu blocks of " - "%zu B, %zu B remainder, %zu B checksum", path, - s->blksz, s->len, s->rem, s->csum); + "%zu B, %zu B remainder, %zu B checksum", path, + s->blksz, s->len, s->rem, s->csum); if (s->blksz) { s->blks = calloc(s->blksz, sizeof(struct blk)); @@ -311,13 +312,13 @@ blk_recv(struct sess *sess, int fd, const char *path) s->rem : s->len; offs += b->len; - LOG4(sess, "%s: read block %zu, " - "length %zu B", path, b->idx, b->len); + LOG4(sess, "%s: read block %zu, length %zu B", + path, b->idx, b->len); } s->size = offs; - LOG3(sess, "%s: read blocks: %zu blocks, %jd B total " - "blocked data", path, s->blksz, (intmax_t)s->size); + LOG3(sess, "%s: read blocks: %zu blocks, %jd B total blocked data", + path, s->blksz, (intmax_t)s->size); return s; out: free(s->blks); @@ -415,8 +416,8 @@ blk_send(struct sess *sess, int fd, size_t idx, } LOG3(sess, "%s: sent block prologue: %zu blocks of %zu B, " - "%zu B remainder, %zu B checksum", path, - p->blksz, p->len, p->rem, p->csum); + "%zu B remainder, %zu B checksum", + path, p->blksz, p->len, p->rem, p->csum); rc = 1; out: free(buf); diff --git a/usr.bin/rsync/client.c b/usr.bin/rsync/client.c index 83bef820edc..ba32e88e7e8 100644 --- a/usr.bin/rsync/client.c +++ b/usr.bin/rsync/client.c @@ -1,4 +1,4 @@ -/* $Id: client.c,v 1.13 2019/03/23 00:20:55 deraadt Exp $ */ +/* $Id: client.c,v 1.14 2019/03/23 16:04:28 deraadt Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -68,9 +68,8 @@ rsync_client(const struct opts *opts, int fd, const struct fargs *f) goto out; } - LOG2(&sess, "client detected client version %" PRId32 - ", server version %" PRId32 ", seed %" PRId32, - sess.lver, sess.rver, sess.seed); + LOG2(&sess, "client detected client version %d, server version %d, seed %d", + sess.lver, sess.rver, sess.seed); sess.mplex_reads = 1; diff --git a/usr.bin/rsync/downloader.c b/usr.bin/rsync/downloader.c index a2b8aaa3751..a65f23d7a30 100644 --- a/usr.bin/rsync/downloader.c +++ b/usr.bin/rsync/downloader.c @@ -1,4 +1,4 @@ -/* $Id: downloader.c,v 1.17 2019/02/18 22:47:34 benno Exp $ */ +/* $Id: downloader.c,v 1.18 2019/03/23 16:04:28 deraadt Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -103,7 +103,7 @@ log_file(struct sess *sess, } LOG1(sess, "%s (%.*f %s, %.1f%% downloaded)", - f->path, prec, tot, unit, frac); + f->path, prec, tot, unit, frac); } /* @@ -489,9 +489,9 @@ again: } else if (rawtok < 0) { tok = -rawtok - 1; if (tok >= p->blk.blksz) { - ERRX(sess, "%s: token not in block " - "set: %zu (have %zu blocks)", - p->fname, tok, p->blk.blksz); + ERRX(sess, + "%s: token not in block set: %zu (have %zu blocks)", + p->fname, tok, p->blk.blksz); goto out; } sz = tok == p->blk.blksz - 1 ? p->blk.rem : p->blk.len; diff --git a/usr.bin/rsync/flist.c b/usr.bin/rsync/flist.c index abfd25b66cb..1493748114d 100644 --- a/usr.bin/rsync/flist.c +++ b/usr.bin/rsync/flist.c @@ -1,4 +1,4 @@ -/* $Id: flist.c,v 1.20 2019/03/18 15:33:21 deraadt Exp $ */ +/* $Id: flist.c,v 1.21 2019/03/23 16:04:28 deraadt Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2019 Florian Obser <florian@openbsd.org> @@ -467,8 +467,7 @@ flist_recv_name(struct sess *sess, int fd, struct flist *f, uint8_t flags, /* FIXME: maximum pathname length. */ if ((len = pathlen + partial) == 0) { - ERRX(sess, "security violation: " - "zero-length pathname"); + ERRX(sess, "security violation: zero-length pathname"); return 0; } @@ -487,8 +486,8 @@ flist_recv_name(struct sess *sess, int fd, struct flist *f, uint8_t flags, } if (f->path[0] == '/') { - ERRX(sess, "security violation: " - "absolute pathname: %s", f->path); + ERRX(sess, "security violation: absolute pathname: %s", + f->path); return 0; } @@ -496,8 +495,8 @@ flist_recv_name(struct sess *sess, int fd, struct flist *f, uint8_t flags, (len > 2 && strcmp(f->path + len - 3, "/..") == 0) || (len > 2 && strncmp(f->path, "../", 3) == 0) || strcmp(f->path, "..") == 0) { - ERRX(sess, "%s: security violation: " - "backtracking pathname", f->path); + ERRX(sess, "%s: security violation: backtracking pathname", + f->path); return 0; } @@ -668,8 +667,7 @@ flist_recv(struct sess *sess, int fd, struct flist **flp, size_t *sz) } ff->st.uid = ival; } else if (fflast == NULL) { - ERRX(sess, "same uid " - "without last entry"); + ERRX(sess, "same uid without last entry"); goto out; } else ff->st.uid = fflast->st.uid; @@ -685,8 +683,7 @@ flist_recv(struct sess *sess, int fd, struct flist **flp, size_t *sz) } ff->st.gid = ival; } else if (fflast == NULL) { - ERRX(sess, "same gid " - "without last entry"); + ERRX(sess, "same gid without last entry"); goto out; } else ff->st.gid = fflast->st.gid; @@ -909,8 +906,7 @@ flist_gen_dirent(struct sess *sess, char *root, struct flist **fl, size_t *sz, assert(ent->fts_statp != NULL); if (S_ISLNK(ent->fts_statp->st_mode) && !sess->opts->preserve_links) { - WARNX(sess, "%s: skipping " - "symlink", ent->fts_path); + WARNX(sess, "%s: skipping symlink", ent->fts_path); continue; } @@ -1040,8 +1036,7 @@ flist_gen_files(struct sess *sess, size_t argc, char **argv, continue; } else if (S_ISLNK(st.st_mode)) { if (!sess->opts->preserve_links) { - WARNX(sess, "%s: skipping " - "symlink", argv[i]); + WARNX(sess, "%s: skipping symlink", argv[i]); continue; } } else if (!S_ISREG(st.st_mode)) { diff --git a/usr.bin/rsync/ids.c b/usr.bin/rsync/ids.c index 4ef97186a58..f4c77f5f22d 100644 --- a/usr.bin/rsync/ids.c +++ b/usr.bin/rsync/ids.c @@ -1,4 +1,4 @@ -/* $Id: ids.c,v 1.8 2019/02/21 22:13:43 benno Exp $ */ +/* $Id: ids.c,v 1.9 2019/03/23 16:04:28 deraadt Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -133,8 +133,8 @@ idents_remap(struct sess *sess, int isgid, struct ident *ids, size_t idsz) else ids[i].mapped = id; - LOG4(sess, "remapped identifier %s: %" PRId32 " -> %" PRId32, - ids[i].name, ids[i].id, ids[i].mapped); + LOG4(sess, "remapped identifier %s: %d -> %d", + ids[i].name, ids[i].id, ids[i].mapped); } } @@ -171,23 +171,23 @@ idents_add(struct sess *sess, int isgid, assert(i == *idsz); if (isgid) { if ((grp = getgrgid((gid_t)id)) == NULL) { - ERR(sess, "%" PRId32 ": unknown gid", id); + ERR(sess, "%d: unknown gid", id); return 0; } name = grp->gr_name; } else { if ((usr = getpwuid((uid_t)id)) == NULL) { - ERR(sess, "%" PRId32 ": unknown uid", id); + ERR(sess, "%d: unknown uid", id); return 0; } name = usr->pw_name; } if ((sz = strlen(name)) > UINT8_MAX) { - ERRX(sess, "%" PRId32 ": name too long: %s", id, name); + ERRX(sess, "%d: name too long: %s", id, name); return 0; } else if (sz == 0) { - ERRX(sess, "%" PRId32 ": zero-length name", id); + ERRX(sess, "%d: zero-length name", id); return 0; } @@ -207,7 +207,7 @@ idents_add(struct sess *sess, int isgid, } LOG4(sess, "adding identifier to list: %s (%u)", - (*ids)[*idsz].name, (*ids)[*idsz].id); + (*ids)[*idsz].name, (*ids)[*idsz].id); (*idsz)++; return 1; } @@ -289,8 +289,7 @@ idents_recv(struct sess *sess, ERRX1(sess, "io_read_byte"); return 0; } else if (sz == 0) - WARNX(sess, "zero-length name " - "in identifier list"); + WARNX(sess, "zero-length name in identifier list"); (*ids)[*idsz].id = id; (*ids)[*idsz].name = calloc(sz + 1, 1); diff --git a/usr.bin/rsync/main.c b/usr.bin/rsync/main.c index 738565eb60c..2e8a2b8e75a 100644 --- a/usr.bin/rsync/main.c +++ b/usr.bin/rsync/main.c @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.34 2019/03/23 00:20:55 deraadt Exp $ */ +/* $Id: main.c,v 1.35 2019/03/23 16:04:28 deraadt Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -111,8 +111,7 @@ fargs_parse(size_t argc, char *argv[], struct opts *opts) if (fargs_is_remote(f->sources[0])) { if (f->host != NULL) - errx(1, "both source and " - "destination cannot be remote files"); + errx(1, "both source and destination cannot be remote files"); f->mode = FARGS_RECEIVER; if ((f->host = strdup(f->sources[0])) == NULL) err(1, "strdup"); @@ -125,8 +124,7 @@ fargs_parse(size_t argc, char *argv[], struct opts *opts) len = strlen(f->host) - 8 + 1; memmove(f->host, f->host + 8, len); if ((cp = strchr(f->host, '/')) == NULL) - errx(1, "rsync protocol requires a module " - "name"); + errx(1, "rsync protocol requires a module name"); *cp++ = '\0'; f->module = cp; if ((cp = strchr(f->module, '/')) != NULL) @@ -163,9 +161,9 @@ fargs_parse(size_t argc, char *argv[], struct opts *opts) for (i = 0; i < f->sourcesz; i++) { if (!fargs_is_remote(f->sources[i])) continue; - errx(1, "remote file in " - "list of local sources: %s", - f->sources[i]); + errx(1, + "remote file in list of local sources: %s", + f->sources[i]); } if (f->mode == FARGS_RECEIVER) for (i = 0; i < f->sourcesz; i++) { @@ -173,13 +171,11 @@ fargs_parse(size_t argc, char *argv[], struct opts *opts) !fargs_is_daemon(f->sources[i])) continue; if (fargs_is_daemon(f->sources[i])) - errx(1, "remote " - "daemon in list of " - "remote sources: %s", - f->sources[i]); - errx(1, "local file in " - "list of remote sources: %s", - f->sources[i]); + errx(1, "remote daemon in list of " + "remote sources: %s", + f->sources[i]); + errx(1, "local file in list of remote sources: %s", + f->sources[i]); } } else { if (f->mode != FARGS_RECEIVER) @@ -234,8 +230,8 @@ fargs_parse(size_t argc, char *argv[], struct opts *opts) *ccp = '\0'; if (strncmp(cp, f->host, len) || (cp[len] != '/' && cp[len] != '\0')) - errx(1, "different remote " - "host: %s", f->sources[i]); + errx(1, "different remote host: %s", + f->sources[i]); memmove(f->sources[i], f->sources[i] + len + 8 + 1, j - len - 8); @@ -247,8 +243,8 @@ fargs_parse(size_t argc, char *argv[], struct opts *opts) /* host::path */ if (strncmp(cp, f->host, len) || (cp[len] != ':' && cp[len] != '\0')) - errx(1, "different remote " - "host: %s", f->sources[i]); + errx(1, "different remote host: %s", + f->sources[i]); memmove(f->sources[i], f->sources[i] + len + 2, j - len - 1); } else if (cp[0] == ':') { @@ -258,8 +254,8 @@ fargs_parse(size_t argc, char *argv[], struct opts *opts) /* host:path */ if (strncmp(cp, f->host, len) || (cp[len] != ':' && cp[len] != '\0')) - errx(1, "different remote " - "host: %s", f->sources[i]); + errx(1, "different remote host: %s", + f->sources[i]); memmove(f->sources[i], f->sources[i] + len + 1, j - len); } diff --git a/usr.bin/rsync/receiver.c b/usr.bin/rsync/receiver.c index 74f1fc6e389..873c5d2df69 100644 --- a/usr.bin/rsync/receiver.c +++ b/usr.bin/rsync/receiver.c @@ -1,4 +1,4 @@ -/* $Id: receiver.c,v 1.20 2019/03/22 19:56:47 cheloha Exp $ */ +/* $Id: receiver.c,v 1.21 2019/03/23 16:04:28 deraadt Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv> @@ -68,7 +68,7 @@ rsync_set_metadata(struct sess *sess, int newfile, return 0; } WARNX(sess, "%s: identity unknown or not available " - "to user.group: %u.%u", f->path, uid, gid); + "to user.group: %u.%u", f->path, uid, gid); } else LOG4(sess, "%s: updated uid and/or gid", f->path); } @@ -127,7 +127,7 @@ rsync_set_metadata_at(struct sess *sess, int newfile, int rootfd, return 0; } WARNX(sess, "%s: identity unknown or not available " - "to user.group: %u.%u", f->path, uid, gid); + "to user.group: %u.%u", f->path, uid, gid); } else LOG4(sess, "%s: updated uid and/or gid", f->path); } @@ -396,8 +396,9 @@ rsync_receiver(struct sess *sess, int fdin, int fdout, const char *root) } else if (c == 0) { assert(phase == 0); phase++; - LOG2(sess, "%s: receiver ready " - "for phase 2 data", root); + LOG2(sess, + "%s: receiver ready for phase 2 data", + root); break; } diff --git a/usr.bin/rsync/sender.c b/usr.bin/rsync/sender.c index e536a715024..50377c61cda 100644 --- a/usr.bin/rsync/sender.c +++ b/usr.bin/rsync/sender.c @@ -1,4 +1,4 @@ -/* $Id: sender.c,v 1.19 2019/02/21 22:11:26 benno Exp $ */ +/* $Id: sender.c,v 1.20 2019/03/23 16:04:28 deraadt Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -175,10 +175,10 @@ send_up_fsm(struct sess *sess, size_t *phase, */ if (!sess->opts->dry_run) - LOG3(sess, "%s: flushed %jd KB total, %.2f%% " - "uploaded", fl[up->cur->idx].path, - (intmax_t)up->stat.total / 1024, - 100.0 * up->stat.dirty / up->stat.total); + LOG3(sess, "%s: flushed %jd KB total, %.2f%% uploaded", + fl[up->cur->idx].path, + (intmax_t)up->stat.total / 1024, + 100.0 * up->stat.dirty / up->stat.total); send_up_reset(up); return 1; case BLKSTAT_PHASE: @@ -264,8 +264,7 @@ send_up_fsm(struct sess *sess, size_t *phase, io_lowbuffer_buf(sess, *wb, &pos, *wbsz, buf, 20); LOG3(sess, "%s: primed for %jd B total", - fl[up->cur->idx].path, - (intmax_t)up->cur->blks->size); + fl[up->cur->idx].path, (intmax_t)up->cur->blks->size); up->stat.curst = BLKSTAT_NEXT; } @@ -302,8 +301,8 @@ send_dl_enqueue(struct sess *sess, struct send_dlq *q, /* Validate the index. */ if (idx < 0 || (uint32_t)idx >= flsz) { - ERRX(sess, "file index out of bounds: invalid %" - PRId32 " out of %zu", idx, flsz); + ERRX(sess, "file index out of bounds: invalid %d out of %zu", + idx, flsz); return 0; } else if (S_ISDIR(fl[idx].st.mode)) { ERRX(sess, "blocks requested for " diff --git a/usr.bin/rsync/server.c b/usr.bin/rsync/server.c index 6d7835a82be..5b0ab5cf81b 100644 --- a/usr.bin/rsync/server.c +++ b/usr.bin/rsync/server.c @@ -1,4 +1,4 @@ -/* $Id: server.c,v 1.9 2019/03/23 00:20:55 deraadt Exp $ */ +/* $Id: server.c,v 1.10 2019/03/23 16:04:28 deraadt Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -96,9 +96,8 @@ rsync_server(const struct opts *opts, size_t argc, char *argv[]) goto out; } - LOG2(&sess, "server detected client version %" PRId32 - ", server version %" PRId32 ", seed %" PRId32, - sess.rver, sess.lver, sess.seed); + LOG2(&sess, "server detected client version %d, server version %d, seed %d", + sess.rver, sess.lver, sess.seed); if (sess.opts->sender) { LOG2(&sess, "server starting sender"); @@ -112,8 +111,7 @@ rsync_server(const struct opts *opts, size_t argc, char *argv[]) */ if (strcmp(argv[0], ".")) { - ERRX(&sess, "first argument must " - "be a standalone period"); + ERRX(&sess, "first argument must be a standalone period"); goto out; } argv++; @@ -137,12 +135,10 @@ rsync_server(const struct opts *opts, size_t argc, char *argv[]) */ if (argc != 2) { - ERRX(&sess, "server receiver mode " - "requires two argument"); + ERRX(&sess, "server receiver mode requires two argument"); goto out; } else if (strcmp(argv[0], ".")) { - ERRX(&sess, "first argument must " - "be a standalone period"); + ERRX(&sess, "first argument must be a standalone period"); goto out; } diff --git a/usr.bin/rsync/session.c b/usr.bin/rsync/session.c index 8561a33eb10..a72006b07dc 100644 --- a/usr.bin/rsync/session.c +++ b/usr.bin/rsync/session.c @@ -1,4 +1,4 @@ -/* $Id: session.c,v 1.4 2019/02/11 21:41:22 deraadt Exp $ */ +/* $Id: session.c,v 1.5 2019/03/23 16:04:28 deraadt Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -86,12 +86,10 @@ stats_log(struct sess *sess, ts = tsize; LOG1(sess, "Transfer complete: " - "%.*lf %s sent, " - "%.*lf %s read, " - "%.*lf %s file size", - trsz, tr, tru, - twsz, tw, twu, - tssz, ts, tsu); + "%.*lf %s sent, %.*lf %s read, %.*lf %s file size", + trsz, tr, tru, + twsz, tw, twu, + tssz, ts, tsu); } /* diff --git a/usr.bin/rsync/socket.c b/usr.bin/rsync/socket.c index 59089d769ac..0f36b883541 100644 --- a/usr.bin/rsync/socket.c +++ b/usr.bin/rsync/socket.c @@ -1,4 +1,4 @@ -/* $Id: socket.c,v 1.20 2019/03/23 00:20:55 deraadt Exp $ */ +/* $Id: socket.c,v 1.21 2019/03/23 16:04:28 deraadt Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -402,10 +402,9 @@ rsync_socket(const struct opts *opts, const struct fargs *f) /* Now we've completed the handshake. */ if (sess.rver < sess.lver) { - ERRX(&sess, "remote protocol is older " - "than our own (%" PRId32 " < %" PRId32 "): " - "this is not supported", - sess.rver, sess.lver); + ERRX(&sess, "remote protocol is older than our own (%d < %d): " + "this is not supported", + sess.rver, sess.lver); rc = 2; goto out; } @@ -413,9 +412,8 @@ rsync_socket(const struct opts *opts, const struct fargs *f) sess.mplex_reads = 1; LOG2(&sess, "read multiplexing enabled"); - LOG2(&sess, "socket detected client version %" PRId32 - ", server version %" PRId32 ", seed %" PRId32, - sess.lver, sess.rver, sess.seed); + LOG2(&sess, "socket detected client version %d, server version %d, seed %d", + sess.lver, sess.rver, sess.seed); assert(f->mode == FARGS_RECEIVER); diff --git a/usr.bin/rsync/uploader.c b/usr.bin/rsync/uploader.c index 1ef58e73a12..04a133706ac 100644 --- a/usr.bin/rsync/uploader.c +++ b/usr.bin/rsync/uploader.c @@ -1,4 +1,4 @@ -/* $Id: uploader.c,v 1.18 2019/03/18 15:33:21 deraadt Exp $ */ +/* $Id: uploader.c,v 1.19 2019/03/23 16:04:28 deraadt Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2019 Florian Obser <florian@openbsd.org> @@ -223,8 +223,7 @@ pre_link(struct upload *p, struct sess *sess) if (strcmp(f->link, b)) { free(b); b = NULL; - LOG3(sess, "%s: updating " - "symlink: %s", f->path, f->link); + LOG3(sess, "%s: updating symlink: %s", f->path, f->link); updatelink = 1; } free(b); @@ -237,8 +236,7 @@ pre_link(struct upload *p, struct sess *sess) */ if (rc == -1 || updatelink) { - LOG3(sess, "%s: creating " - "symlink: %s", f->path, f->link); + LOG3(sess, "%s: creating symlink: %s", f->path, f->link); if (mktemplate(sess, &temp, f->path, sess->opts->recursive) == -1) { ERRX1(sess, "mktemplate"); @@ -948,8 +946,8 @@ rsync_uploader(struct upload *u, int *fileinfd, close(*fileinfd); *fileinfd = -1; LOG3(sess, "%s: mapped %jd B with %zu blocks", - u->fl[u->idx].path, (intmax_t)blk.size, - blk.blksz); + u->fl[u->idx].path, (intmax_t)blk.size, + blk.blksz); } else { if (*fileinfd != -1) { close(*fileinfd); |