diff options
author | 2015-01-21 03:18:31 +0000 | |
---|---|---|
committer | 2015-01-21 03:18:31 +0000 | |
commit | 940a5a2d01caf7ee6040d40b0224e1e4ac00e2ee (patch) | |
tree | ed2ae087ac29e81900d06d89673a8292a8741bab /usr.bin/rdist/client.c | |
parent | Fix deferred host DNS lookups. (diff) | |
download | wireguard-openbsd-940a5a2d01caf7ee6040d40b0224e1e4ac00e2ee.tar.xz wireguard-openbsd-940a5a2d01caf7ee6040d40b0224e1e4ac00e2ee.zip |
Reduce opt_t from long to int.
Debug message consistency: format opts with %#x and modes with %#04o
Diffstat (limited to 'usr.bin/rdist/client.c')
-rw-r--r-- | usr.bin/rdist/client.c | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/usr.bin/rdist/client.c b/usr.bin/rdist/client.c index c5081cc8eae..3bf967e49a8 100644 --- a/usr.bin/rdist/client.c +++ b/usr.bin/rdist/client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: client.c,v 1.33 2015/01/20 09:00:16 guenther Exp $ */ +/* $OpenBSD: client.c,v 1.34 2015/01/21 03:18:31 guenther Exp $ */ /* * Copyright (c) 1983 Regents of the University of California. @@ -371,8 +371,7 @@ sendhardlink(opt_t opts, struct linkbuf *lp, char *rname, int destdir) } ENCODE(elname, lname); ENCODE(ername, rname); - (void) sendcmd(C_RECVHARDLINK, "%lo %s %s", - opts, elname, ername); + (void) sendcmd(C_RECVHARDLINK, "%o %s %s", opts, elname, ername); return(response()); } @@ -405,7 +404,7 @@ sendfile(char *rname, opt_t opts, struct stat *stb, char *user, */ ENCODE(ername, rname); - (void) sendcmd(C_RECVREG, "%lo %04o %lld %lld %lld %s %s %s", + (void) sendcmd(C_RECVREG, "%o %04o %lld %lld %lld %s %s %s", opts, stb->st_mode & 07777, (long long) stb->st_size, (long long)stb->st_mtime, (long long)stb->st_atime, user, group, ername); @@ -594,7 +593,7 @@ senddir(char *rname, opt_t opts, struct stat *stb, char *user, * Send recvdir command in recvit() format. */ ENCODE(ername, rname); - (void) sendcmd(C_RECVDIR, "%lo %04o 0 0 0 %s %s %s", + (void) sendcmd(C_RECVDIR, "%o %04o 0 0 0 %s %s %s", opts, stb->st_mode & 07777, user, group, ername); if (response() < 0) return(-1); @@ -664,7 +663,7 @@ sendlink(char *rname, opt_t opts, struct stat *stb, char *user, u_char *s; char ername[PATH_MAX*4]; - debugmsg(DM_CALL, "sendlink(%s, %lx, stb, %d)\n", rname, opts, destdir); + debugmsg(DM_CALL, "sendlink(%s, %#x, stb, %d)\n", rname, opts, destdir); if (stb->st_nlink > 1) { struct linkbuf *lp; @@ -677,7 +676,7 @@ sendlink(char *rname, opt_t opts, struct stat *stb, char *user, * Gather and send basic link info */ ENCODE(ername, rname); - (void) sendcmd(C_RECVSYMLINK, "%lo %04o %lld %lld %lld %s %s %s", + (void) sendcmd(C_RECVSYMLINK, "%o %04o %lld %lld %lld %s %s %s", opts, stb->st_mode & 07777, (long long) stb->st_size, (long long)stb->st_mtime, (long long)stb->st_atime, user, group, ername); @@ -783,7 +782,7 @@ update(char *rname, opt_t opts, struct stat *statp) u_char *cp; char ername[PATH_MAX*4]; - debugmsg(DM_CALL, "update(%s, 0x%lx, %p)\n", rname, opts, statp); + debugmsg(DM_CALL, "update(%s, %#x, %p)\n", rname, opts, statp); switch (statp->st_mode & S_IFMT) { case S_IFBLK: @@ -930,7 +929,7 @@ update(char *rname, opt_t opts, struct stat *statp) */ lmode = statp->st_mode & 07777; - debugmsg(DM_MISC, "update(%s,) local mode %04o remote mode %04o\n", + debugmsg(DM_MISC, "update(%s,) local mode %#04o remote mode %#04o\n", rname, lmode, rmode); debugmsg(DM_MISC, "update(%s,) size %lld mtime %lld owner '%s' grp '%s'" "\n", rname, (long long) size, (long long)mtime, owner, group); @@ -952,7 +951,7 @@ update(char *rname, opt_t opts, struct stat *statp) } if (!IS_ON(opts, DO_NOCHKMODE) && lmode != rmode) { - debugmsg(DM_MISC, "modes do not match (%04o != %04o).\n", + debugmsg(DM_MISC, "modes do not match (%#04o != %#04o).\n", lmode, rmode); return(US_CHMOG); } @@ -1051,15 +1050,15 @@ statupdate(int u, char *starget, opt_t opts, char *rname, int destdir, if (u == US_CHMOG) { if (IS_ON(opts, DO_VERIFY)) { message(MT_INFO, - "%s: need to change to perm %04o, owner %s, group %s", + "%s: need to change to perm %#04o, owner %s, group %s", starget, lmode, user, group); runspecial(starget, opts, rname, destdir); } else { - message(MT_CHANGE, "%s: change to perm %04o, owner %s, group %s", + message(MT_CHANGE, "%s: change to perm %#04o, owner %s, group %s", starget, lmode, user, group); ENCODE(ername, rname); - (void) sendcmd(C_CHMOG, "%lo %04o %s %s %s", + (void) sendcmd(C_CHMOG, "%o %04o %s %s %s", opts, lmode, user, group, ername); (void) response(); } @@ -1121,7 +1120,7 @@ fullupdate(int u, char *starget, opt_t opts, char *rname, int destdir, } return (sendfile(rname, opts, st, user, group, destdir) == 0); } else { - message(MT_INFO, "%s: unknown file type 0%o", starget, + message(MT_INFO, "%s: unknown file type %#o", starget, st->st_mode); return(0); } @@ -1152,7 +1151,7 @@ sendit(char *rname, opt_t opts, int destdir) if (checkfilename(rname) != 0) return(-1); - debugmsg(DM_CALL, "sendit(%s, 0x%lx) called\n", rname, opts); + debugmsg(DM_CALL, "sendit(%s, %#x) called\n", rname, opts); if (except(target)) return(0); @@ -1164,7 +1163,7 @@ sendit(char *rname, opt_t opts, int destdir) * Does rname need updating? */ u = update(rname, opts, &stb); - debugmsg(DM_MISC, "sendit(%s, 0x%lx): update status of %s is %d\n", + debugmsg(DM_MISC, "sendit(%s, %#x): update status of %s is %d\n", rname, opts, target, u); /* @@ -1224,7 +1223,7 @@ install(char *src, char *dest, int ddir, int destdir, opt_t opts) char ername[PATH_MAX*4]; debugmsg(DM_CALL, - "install(src=%s,dest=%s,ddir=%d,destdir=%d,opts=%ld) start\n", + "install(src=%s,dest=%s,ddir=%d,destdir=%d,opts=%#x) start\n", (src?src:"NULL"), (dest?dest:"NULL"), ddir, destdir, opts); /* * Save source name @@ -1294,9 +1293,9 @@ install(char *src, char *dest, int ddir, int destdir, opt_t opts) */ ENCODE(ername, dest); if (ddir) - (void) sendcmd(C_DIRTARGET, "%lo %s", opts, ername); + (void) sendcmd(C_DIRTARGET, "%o %s", opts, ername); else - (void) sendcmd(C_TARGET, "%lo %s", opts, ername); + (void) sendcmd(C_TARGET, "%o %s", opts, ername); if (response() < 0) return(-1); |