Module Name: src Committed By: christos Date: Fri Oct 16 12:41:37 UTC 2009
Modified Files: src/usr.sbin/sup/source: log.c nxtarg.c quit.c scm.c scmio.c skipto.c stree.c supcmain.c supcmeat.c supcmisc.c supextern.h supfilesrv.c supmsg.c supmsg.h Log Message: constification from Paul Ripke to make it compile on OS/X To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/usr.sbin/sup/source/log.c cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/sup/source/nxtarg.c \ src/usr.sbin/sup/source/quit.c src/usr.sbin/sup/source/skipto.c cvs rdiff -u -r1.26 -r1.27 src/usr.sbin/sup/source/scm.c cvs rdiff -u -r1.16 -r1.17 src/usr.sbin/sup/source/scmio.c cvs rdiff -u -r1.12 -r1.13 src/usr.sbin/sup/source/stree.c cvs rdiff -u -r1.27 -r1.28 src/usr.sbin/sup/source/supcmain.c cvs rdiff -u -r1.34 -r1.35 src/usr.sbin/sup/source/supcmeat.c cvs rdiff -u -r1.19 -r1.20 src/usr.sbin/sup/source/supcmisc.c cvs rdiff -u -r1.20 -r1.21 src/usr.sbin/sup/source/supextern.h cvs rdiff -u -r1.41 -r1.42 src/usr.sbin/sup/source/supfilesrv.c cvs rdiff -u -r1.15 -r1.16 src/usr.sbin/sup/source/supmsg.c cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/sup/source/supmsg.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.sbin/sup/source/log.c diff -u src/usr.sbin/sup/source/log.c:1.9 src/usr.sbin/sup/source/log.c:1.10 --- src/usr.sbin/sup/source/log.c:1.9 Thu Dec 20 15:17:52 2007 +++ src/usr.sbin/sup/source/log.c Fri Oct 16 08:41:37 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: log.c,v 1.9 2007/12/20 20:17:52 christos Exp $ */ +/* $NetBSD: log.c,v 1.10 2009/10/16 12:41:37 christos Exp $ */ /* * Copyright (c) 1992 Carnegie Mellon University @@ -64,7 +64,7 @@ } void -logquit(int retval, char *fmt, ...) +logquit(int retval, const char *fmt, ...) { char buf[STRINGLENGTH]; va_list ap; @@ -81,7 +81,7 @@ } void -logerr(char *fmt, ...) +logerr(const char *fmt, ...) { char buf[STRINGLENGTH]; va_list ap; @@ -98,7 +98,7 @@ } void -loginfo(char *fmt, ...) +loginfo(const char *fmt, ...) { char buf[STRINGLENGTH]; va_list ap; @@ -131,7 +131,7 @@ int deny_severity = LIBWRAP_DENY_FACILITY | LIBWRAP_DENY_SEVERITY; void -logdeny(char *fmt, ...) +logdeny(const char *fmt, ...) { char buf[STRINGLENGTH]; va_list ap; @@ -148,7 +148,7 @@ } void -logallow(char *fmt, ...) +logallow(const char *fmt, ...) { char buf[STRINGLENGTH]; va_list ap; Index: src/usr.sbin/sup/source/nxtarg.c diff -u src/usr.sbin/sup/source/nxtarg.c:1.5 src/usr.sbin/sup/source/nxtarg.c:1.6 --- src/usr.sbin/sup/source/nxtarg.c:1.5 Wed Jul 10 16:19:41 2002 +++ src/usr.sbin/sup/source/nxtarg.c Fri Oct 16 08:41:37 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: nxtarg.c,v 1.5 2002/07/10 20:19:41 wiz Exp $ */ +/* $NetBSD: nxtarg.c,v 1.6 2009/10/16 12:41:37 christos Exp $ */ /* * Copyright (c) 1991 Carnegie Mellon University @@ -27,8 +27,8 @@ /* * nxtarg -- strip off arguments from a string * - * Usage: p = nxtarg (&q,brk); - * char *p,*q,*brk; + * Usage: p = nxtarg (&q,sep); + * char *p,*q,*sep; * extern char _argbreak; * * q is pointer to next argument in string @@ -36,12 +36,12 @@ * q points to remainder of string * * Leading blanks and tabs are skipped; the argument ends at the - * first occurence of one of the characters in the string "brk". + * first occurence of one of the characters in the string "sep". * When such a character is found, it is put into the external * variable "_argbreak", and replaced by a null character; if the * arg string ends before that, then the null character is * placed into _argbreak; - * If "brk" is 0, then " " is substituted. + * If "sep" is 0, then " " is substituted. * * HISTORY * 01-Jul-83 Steven Shafer (sas) at Carnegie-Mellon University @@ -60,7 +60,7 @@ char _argbreak; char * -nxtarg(char **q, char *brk) +nxtarg(char **q, const char *sep) { char *front, *back; front = *q; /* start of string */ @@ -68,9 +68,9 @@ while (*front && (*front == ' ' || *front == '\t')) front++; /* find break character at end */ - if (brk == 0) - brk = " "; - back = skipto(front, brk); + if (sep == 0) + sep = " "; + back = skipto(front, sep); _argbreak = *back; *q = (*back ? back + 1 : back); /* next arg start loc */ /* elim trailing blanks and tabs */ Index: src/usr.sbin/sup/source/quit.c diff -u src/usr.sbin/sup/source/quit.c:1.5 src/usr.sbin/sup/source/quit.c:1.6 --- src/usr.sbin/sup/source/quit.c:1.5 Wed Jul 10 16:19:41 2002 +++ src/usr.sbin/sup/source/quit.c Fri Oct 16 08:41:37 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: quit.c,v 1.5 2002/07/10 20:19:41 wiz Exp $ */ +/* $NetBSD: quit.c,v 1.6 2009/10/16 12:41:37 christos Exp $ */ /* * Copyright (c) 1991 Carnegie Mellon University @@ -49,7 +49,7 @@ #include "supextern.h" void -quit(int status, char *fmt, ...) +quit(int status, const char *fmt, ...) { va_list args; Index: src/usr.sbin/sup/source/skipto.c diff -u src/usr.sbin/sup/source/skipto.c:1.5 src/usr.sbin/sup/source/skipto.c:1.6 --- src/usr.sbin/sup/source/skipto.c:1.5 Wed Jul 10 16:19:43 2002 +++ src/usr.sbin/sup/source/skipto.c Fri Oct 16 08:41:37 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: skipto.c,v 1.5 2002/07/10 20:19:43 wiz Exp $ */ +/* $NetBSD: skipto.c,v 1.6 2009/10/16 12:41:37 christos Exp $ */ /* * Copyright (c) 1991 Carnegie Mellon University @@ -58,9 +58,9 @@ static char tab[256] = { 0 }; char * -skipto(char *string, char *charset) +skipto(const char *string, const char *charset) { - char *setp, *strp; + const char *setp, *strp; tab[0] = 1; /* Stop on a null, too. */ for (setp = charset; *setp; setp++) @@ -69,13 +69,13 @@ continue; for (setp = charset; *setp; setp++) tab[(unsigned char) *setp] = 0; - return strp; + return __UNCONST(strp); } char * -skipover(char *string, char *charset) +skipover(const char *string, const char *charset) { - char *setp, *strp; + const char *setp, *strp; tab[0] = 0; /* Do not skip over nulls. */ for (setp = charset; *setp; setp++) @@ -84,5 +84,5 @@ continue; for (setp = charset; *setp; setp++) tab[(unsigned char) *setp] = 0; - return strp; + return __UNCONST(strp); } Index: src/usr.sbin/sup/source/scm.c diff -u src/usr.sbin/sup/source/scm.c:1.26 src/usr.sbin/sup/source/scm.c:1.27 --- src/usr.sbin/sup/source/scm.c:1.26 Thu Jan 15 10:58:42 2009 +++ src/usr.sbin/sup/source/scm.c Fri Oct 16 08:41:37 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: scm.c,v 1.26 2009/01/15 15:58:42 christos Exp $ */ +/* $NetBSD: scm.c,v 1.27 2009/10/16 12:41:37 christos Exp $ */ /* * Copyright (c) 1992 Carnegie Mellon University @@ -373,7 +373,7 @@ if (*b < 32) *b <<= 1; if (*t != -1) { - if (s > *t) + if (s > (unsigned) *t) s = *t; *t -= s; } @@ -486,7 +486,7 @@ return (name); } -char * +const char * remotehost(void) { /* remote host name (if known) */ char h1[NI_MAXHOST]; @@ -652,7 +652,7 @@ } int -scmerr(int error, char *fmt, ...) +scmerr(int error, const char *fmt, ...) { va_list ap; @@ -692,7 +692,7 @@ return (in); x.ui = in; iy = sizeof(int); - for (ix = 0; ix < sizeof(int); ix++) { + for (ix = 0; ix < (int) sizeof(int); ix++) { --iy; y.uc[iy] = x.uc[ix]; } Index: src/usr.sbin/sup/source/scmio.c diff -u src/usr.sbin/sup/source/scmio.c:1.16 src/usr.sbin/sup/source/scmio.c:1.17 --- src/usr.sbin/sup/source/scmio.c:1.16 Wed May 24 22:10:53 2006 +++ src/usr.sbin/sup/source/scmio.c Fri Oct 16 08:41:37 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: scmio.c,v 1.16 2006/05/25 02:10:53 christos Exp $ */ +/* $NetBSD: scmio.c,v 1.17 2009/10/16 12:41:37 christos Exp $ */ /* * Copyright (c) 1992 Carnegie Mellon University @@ -199,7 +199,7 @@ char *b_ptr; /* pointer to end of buffer */ int b_cnt; /* number of bytes in buffer */ } buffers[2]; -struct buf *bufptr; /* buffer pointer */ +struct buf *gblbufptr; /* buffer pointer */ static int writedata(int, char *); static int writeblock(int, char *); @@ -217,22 +217,22 @@ int x, tries; struct buf *bp; - if (bufptr) { - if (bufptr->b_cnt + count <= FILEXFER) { - memcpy(bufptr->b_ptr, data, count); - bufptr->b_cnt += count; - bufptr->b_ptr += count; + if (gblbufptr) { + if (gblbufptr->b_cnt + count <= FILEXFER) { + memcpy(gblbufptr->b_ptr, data, count); + gblbufptr->b_cnt += count; + gblbufptr->b_ptr += count; return (SCMOK); } - bp = (bufptr == buffers) ? &buffers[1] : buffers; + bp = (gblbufptr == buffers) ? &buffers[1] : buffers; memcpy(bp->b_data, data, count); bp->b_cnt = count; bp->b_ptr = bp->b_data + count; - data = bufptr->b_data; - count = bufptr->b_cnt; - bufptr->b_cnt = 0; - bufptr->b_ptr = bufptr->b_data; - bufptr = bp; + data = gblbufptr->b_data; + count = gblbufptr->b_cnt; + gblbufptr->b_cnt = 0; + gblbufptr->b_ptr = gblbufptr->b_data; + gblbufptr = bp; } tries = 0; for (;;) { @@ -278,11 +278,11 @@ if (scmdebug > 1) loginfo("SCM Writing message %d", msg); - if (bufptr) + if (gblbufptr) return (scmerr(-1, "Buffering already enabled")); - bufptr = buffers; - bufptr->b_ptr = bufptr->b_data; - bufptr->b_cnt = 0; + gblbufptr = buffers; + gblbufptr->b_ptr = gblbufptr->b_data; + gblbufptr->b_cnt = 0; x = byteswap(msg); return (writedata(sizeof(int), (char *) &x)); } @@ -298,15 +298,15 @@ x = writedata(sizeof(int), (char *) &x); if (x != SCMOK) return (x); - if (bufptr == NULL) + if (gblbufptr == NULL) return (scmerr(-1, "Buffering already disabled")); - if (bufptr->b_cnt == 0) { - bufptr = NULL; + if (gblbufptr->b_cnt == 0) { + gblbufptr = NULL; return (SCMOK); } - data = bufptr->b_data; - count = bufptr->b_cnt; - bufptr = NULL; + data = gblbufptr->b_data; + count = gblbufptr->b_cnt; + gblbufptr = NULL; return (writedata(count, data)); } Index: src/usr.sbin/sup/source/stree.c diff -u src/usr.sbin/sup/source/stree.c:1.12 src/usr.sbin/sup/source/stree.c:1.13 --- src/usr.sbin/sup/source/stree.c:1.12 Thu Dec 20 15:17:52 2007 +++ src/usr.sbin/sup/source/stree.c Fri Oct 16 08:41:37 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: stree.c,v 1.12 2007/12/20 20:17:52 christos Exp $ */ +/* $NetBSD: stree.c,v 1.13 2009/10/16 12:41:37 christos Exp $ */ /* * Copyright (c) 1992 Carnegie Mellon University @@ -59,13 +59,13 @@ #include "libc.h" #include "c.h" -static TREE *Tmake(char *); +static TREE *Tmake(const char *); static TREE *Trotll(TREE *, TREE *); static TREE *Trotlh(TREE *, TREE *); static TREE *Trothl(TREE *, TREE *); static TREE *Trothh(TREE *, TREE *); static void Tbalance(TREE **); -static TREE *Tinsertavl(TREE **, char *, int, int *); +static TREE *Tinsertavl(TREE **, const char *, int, int *); static int Tsubprocess(TREE *, int, int (*f) (TREE *, void *), void *); static int Tprintone(TREE *, void *); @@ -94,7 +94,7 @@ } static TREE * -Tmake(char *p) +Tmake(const char *p) { TREE *t; t = (TREE *) malloc(sizeof(TREE)); @@ -192,7 +192,7 @@ } static TREE * -Tinsertavl(TREE ** t, char *p, int find, int *dh) +Tinsertavl(TREE ** t, const char *p, int find, int *dh) { TREE *newt; int cmp; @@ -225,7 +225,7 @@ } TREE * -Tinsert(TREE ** t, char *p, int find) +Tinsert(TREE ** t, const char *p, int find) { int deltah; @@ -240,7 +240,7 @@ } TREE * -Tsearch(TREE * t, char *p) +Tsearch(TREE * t, const char *p) { TREE *x; int cmp; @@ -259,10 +259,11 @@ } TREE * -Tlookup(TREE * t, char *p) +Tlookup(TREE * t, const char *p) { TREE *x; char buf[MAXPATHLEN + 1]; + char *q; if (p == NULL) return (NULL); @@ -279,16 +280,16 @@ return (x); (void) strncpy(buf, p, sizeof(buf) - 1); buf[MAXPATHLEN] = '\0'; - while ((p = rindex(buf, '/')) != NULL) { - while (p >= buf && *(p - 1) == '/') - p--; - if (p == buf) - *(p + 1) = '\0'; + while ((q = rindex(buf, '/')) != NULL) { + while (q >= buf && *(q - 1) == '/') + q--; + if (q == buf) + *(q + 1) = '\0'; else - *p = '\0'; + *q = '\0'; if ((x = Tsearch(t, buf)) != NULL) return (x); - if (p == buf) + if (q == buf) break; } return (NULL); Index: src/usr.sbin/sup/source/supcmain.c diff -u src/usr.sbin/sup/source/supcmain.c:1.27 src/usr.sbin/sup/source/supcmain.c:1.28 --- src/usr.sbin/sup/source/supcmain.c:1.27 Fri Jul 17 16:31:20 2009 +++ src/usr.sbin/sup/source/supcmain.c Fri Oct 16 08:41:37 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: supcmain.c,v 1.27 2009/07/17 20:31:20 jakllsch Exp $ */ +/* $NetBSD: supcmain.c,v 1.28 2009/10/16 12:41:37 christos Exp $ */ /* * Copyright (c) 1992 Carnegie Mellon University @@ -361,14 +361,16 @@ main(int argc, char **argv) { char *progname, *supfname; - int restart, sfdev = 0, sfino = 0; + int restart; + dev_t sfdev = 0; + ino_t sfino = 0; time_t sfmtime = 0; struct stat sbuf; struct sigaction ign; /* initialize global variables */ pgmversion = PGMVERSION;/* export version number */ - server = FALSE; /* export that we're not a server */ + isserver = FALSE; /* export that we're not a server */ collname = NULL; /* no current collection yet */ dontjump = TRUE; /* clear setjmp buffer */ progname = estrdup(argv[0]); @@ -597,7 +599,7 @@ char buf[STRINGLENGTH], *p; const char *u; char username[STRINGLENGTH]; - char *supfname, *arg; + char *supfname, **arg; COLLECTION *c, *lastC; FILE *f; int bogus; Index: src/usr.sbin/sup/source/supcmeat.c diff -u src/usr.sbin/sup/source/supcmeat.c:1.34 src/usr.sbin/sup/source/supcmeat.c:1.35 --- src/usr.sbin/sup/source/supcmeat.c:1.34 Fri Jan 16 05:24:20 2009 +++ src/usr.sbin/sup/source/supcmeat.c Fri Oct 16 08:41:37 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: supcmeat.c,v 1.34 2009/01/16 10:24:20 junyoung Exp $ */ +/* $NetBSD: supcmeat.c,v 1.35 2009/10/16 12:41:37 christos Exp $ */ /* * Copyright (c) 1992 Carnegie Mellon University @@ -1457,7 +1457,7 @@ } void -done(int value, char *fmt, ...) +done(int value, const char *fmt, ...) { char buf[STRINGLENGTH]; va_list ap; Index: src/usr.sbin/sup/source/supcmisc.c diff -u src/usr.sbin/sup/source/supcmisc.c:1.19 src/usr.sbin/sup/source/supcmisc.c:1.20 --- src/usr.sbin/sup/source/supcmisc.c:1.19 Thu Jan 15 10:58:42 2009 +++ src/usr.sbin/sup/source/supcmisc.c Fri Oct 16 08:41:37 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: supcmisc.c,v 1.19 2009/01/15 15:58:42 christos Exp $ */ +/* $NetBSD: supcmisc.c,v 1.20 2009/10/16 12:41:37 christos Exp $ */ /* * Copyright (c) 1992 Carnegie Mellon University @@ -264,7 +264,7 @@ *********************************************/ void -notify(char *fmt, ...) +notify(const char *fmt, ...) { /* record error message */ char buf[STRINGLENGTH]; char collrelname[STRINGLENGTH]; Index: src/usr.sbin/sup/source/supextern.h diff -u src/usr.sbin/sup/source/supextern.h:1.20 src/usr.sbin/sup/source/supextern.h:1.21 --- src/usr.sbin/sup/source/supextern.h:1.20 Thu Jan 15 10:58:42 2009 +++ src/usr.sbin/sup/source/supextern.h Fri Oct 16 08:41:37 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: supextern.h,v 1.20 2009/01/15 15:58:42 christos Exp $ */ +/* $NetBSD: supextern.h,v 1.21 2009/10/16 12:41:37 christos Exp $ */ struct stat; @@ -16,16 +16,16 @@ /* log.c */ void logopen(char *); -void logquit(int, char *, ...) +void logquit(int, const char *, ...) __attribute__((__format__(__printf__, 2, 3))); -void logerr(char *, ...) +void logerr(const char *, ...) __attribute__((__format__(__printf__, 1, 2))) ; -void loginfo(char *, ...) +void loginfo(const char *, ...) __attribute__((__format__(__printf__, 1, 2))); #ifdef LIBWRAP -void logdeny(char *, ...) +void logdeny(const char *, ...) __attribute__((__format__(__printf__, 1, 2))); -void logallow(char *, ...) +void logallow(const char *, ...) __attribute__((__format__(__printf__, 1, 2))); #endif @@ -36,13 +36,13 @@ void encode(char *, char *, int); /* nxtarg.c */ -char *nxtarg(char **, char *); +char *nxtarg(char **, const char *); /* path.c */ void path(char *, char *, char *); /* quit.c */ -void quit(int, char *, ...) +void quit(int, const char *, ...) __attribute__((__format__(__printf__, 2, 3))); /* read_line.c */ @@ -74,11 +74,11 @@ int dobackoff(int *, int *); int request(char *, char *, int *); int requestend(void); -char *remotehost(void); +const char *remotehost(void); int thishost(char *); int samehost(void); int matchhost(char *); -int scmerr(int, char *, ...) +int scmerr(int, const char *, ...) __attribute__((__format__(__printf__, 2, 3))); int byteswap(int); @@ -105,14 +105,14 @@ void crosspatch(void); /* skipto.c */ -char *skipto(char *, char *); -char *skipover(char *, char *); +char *skipto(const char *, const char *); +char *skipover(const char *, const char *); /* stree.c */ void Tfree(TREE **); -TREE *Tinsert(TREE **, char *, int); -TREE *Tsearch(TREE *, char *); -TREE *Tlookup(TREE *, char *); +TREE *Tinsert(TREE **, const char *, int); +TREE *Tsearch(TREE *, const char *); +TREE *Tlookup(TREE *, const char *); int Trprocess(TREE *, int (*)(TREE *, void *), void *); int Tprocess(TREE *, int (*)(TREE *, void *), void *); void Tprint(TREE *, char *); @@ -132,9 +132,9 @@ int recvreg(TREE *, int, struct stat *); int copyfile(char *, char *); void finishup(int); -void done(int, char *, ...) +void done(int, const char *, ...) __attribute__((__format__(__printf__, 2, 3))); -void goaway(char *, ...) +void goaway(const char *, ...) __attribute__((__format__(__printf__, 1, 2))); /* supcmisc.c */ @@ -143,7 +143,7 @@ int makedir(char *, unsigned int, struct stat *); int estabd(char *, char *); void ugconvert(char *, char *, int *, int *, int *); -void notify(char *, ...) +void notify(const char *, ...) __attribute__((__format__(__printf__, 1, 2))); void lockout(int); char *fmttime(time_t); Index: src/usr.sbin/sup/source/supfilesrv.c diff -u src/usr.sbin/sup/source/supfilesrv.c:1.41 src/usr.sbin/sup/source/supfilesrv.c:1.42 --- src/usr.sbin/sup/source/supfilesrv.c:1.41 Thu Dec 20 15:17:52 2007 +++ src/usr.sbin/sup/source/supfilesrv.c Fri Oct 16 08:41:37 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: supfilesrv.c,v 1.41 2007/12/20 20:17:52 christos Exp $ */ +/* $NetBSD: supfilesrv.c,v 1.42 2009/10/16 12:41:37 christos Exp $ */ /* * Copyright (c) 1992 Carnegie Mellon University @@ -363,7 +363,7 @@ char *uconvert(int); char *gconvert(int); char *changeuid(char *, char *, int, int); -void goaway(char *, ...); +void goaway(const char *, ...); char *fmttime(time_t); int local_file(int, struct stat *); int stat_info_ok(struct stat *, struct stat *); @@ -387,7 +387,7 @@ /* initialize global variables */ pgmversion = PGMVERSION;/* export version number */ - server = TRUE; /* export that we're not a server */ + isserver = TRUE; /* export that we're not a server */ collname = NULL; /* no current collection yet */ maxchildren = MAXCHILDREN; /* defined in sup.h */ @@ -593,7 +593,7 @@ uidH[i] = gidH[i] = inodeH[i] = NULL; return; } - server = FALSE; + isserver = FALSE; if (argc < 1) usage(); f = fopen(cryptkey, "r"); @@ -1777,7 +1777,7 @@ } void -goaway(char *fmt, ...) +goaway(const char *fmt, ...) { char buf[STRINGLENGTH]; va_list ap; Index: src/usr.sbin/sup/source/supmsg.c diff -u src/usr.sbin/sup/source/supmsg.c:1.15 src/usr.sbin/sup/source/supmsg.c:1.16 --- src/usr.sbin/sup/source/supmsg.c:1.15 Wed Dec 20 11:33:35 2006 +++ src/usr.sbin/sup/source/supmsg.c Fri Oct 16 08:41:37 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: supmsg.c,v 1.15 2006/12/20 16:33:35 christos Exp $ */ +/* $NetBSD: supmsg.c,v 1.16 2009/10/16 12:41:37 christos Exp $ */ /* * Copyright (c) 1992 Carnegie Mellon University @@ -80,7 +80,7 @@ { int x; - if (server) { + if (isserver) { x = readmsg(MSGSIGNON); if (x == SCMOK) x = readint(&protver); @@ -109,7 +109,7 @@ { int x; - if (server) { + if (isserver) { x = writemsg(MSGSIGNONACK); if (x == SCMOK) x = writeint(PROTOVERSION); @@ -156,7 +156,7 @@ { int x; - if (server) { + if (isserver) { x = readmsg(MSGSETUP); if (x != SCMOK) return (x); @@ -233,7 +233,7 @@ int msgsetupack(void) { - if (server) + if (isserver) return (writemint(MSGSETUPACK, setupack)); return (readmint(MSGSETUPACK, &setupack)); } @@ -245,7 +245,7 @@ int msgcrypt(void) { - if (server) + if (isserver) return (readmstr(MSGCRYPT, &crypttest)); return (writemstr(MSGCRYPT, crypttest)); } @@ -253,7 +253,7 @@ int msgcryptok(void) { - if (server) + if (isserver) return (writemnull(MSGCRYPTOK)); return (readmnull(MSGCRYPTOK)); } @@ -270,7 +270,7 @@ msglogin(void) { int x; - if (server) { + if (isserver) { x = readmsg(MSGLOGIN); if (x == SCMOK) x = readstring(&logcrypt); @@ -298,7 +298,7 @@ msglogack(void) { int x; - if (server) { + if (isserver) { x = writemsg(MSGLOGACK); if (x == SCMOK) x = writeint(logack); @@ -332,7 +332,7 @@ msgrefuse(void) { int x; - if (server) { + if (isserver) { char *name; x = readmsg(MSGREFUSE); if (x == SCMOK) @@ -383,7 +383,7 @@ msglist(void) { int x; - if (server) { + if (isserver) { x = writemsg(MSGLIST); if (x == SCMOK) x = Tprocess(listT, listone, NULL); @@ -443,7 +443,7 @@ msgneed(void) { int x; - if (server) { + if (isserver) { char *name; int update; TREE *t; @@ -490,7 +490,7 @@ msgdeny(void) { int x; - if (server) { + if (isserver) { x = writemsg(MSGDENY); if (x == SCMOK) x = Tprocess(denyT, denyone, NULL); @@ -522,7 +522,7 @@ int msgsend(void) { - if (server) + if (isserver) return (readmnull(MSGSEND)); return (writemnull(MSGSEND)); } @@ -546,7 +546,7 @@ TREE *t = upgradeT; va_start(args, xferfile); - if (server) { + if (isserver) { x = writemsg(MSGRECV); if (t == NULL) { if (x == SCMOK) @@ -664,7 +664,7 @@ printf("Error, msgdone should not have been called."); return (SCMERR); } - if (server) { + if (isserver) { x = readmsg(MSGDONE); if (x == SCMOK) x = readint(&doneack); @@ -705,7 +705,7 @@ int x; int i; - if (server) { + if (isserver) { x = readmsg(MSGXPATCH); if (x != SCMOK) return (x); @@ -746,7 +746,7 @@ int msgcompress(void) { - if (server) + if (isserver) return (readmint(MSGCOMPRESS, &docompress)); return (writemint(MSGCOMPRESS, docompress)); } Index: src/usr.sbin/sup/source/supmsg.h diff -u src/usr.sbin/sup/source/supmsg.h:1.6 src/usr.sbin/sup/source/supmsg.h:1.7 --- src/usr.sbin/sup/source/supmsg.h:1.6 Mon Jan 15 21:50:32 2001 +++ src/usr.sbin/sup/source/supmsg.h Fri Oct 16 08:41:37 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: supmsg.h,v 1.6 2001/01/16 02:50:32 cgd Exp $ */ +/* $NetBSD: supmsg.h,v 1.7 2009/10/16 12:41:37 christos Exp $ */ /* * Copyright (c) 1992 Carnegie Mellon University @@ -109,7 +109,7 @@ #ifdef MSGSUBR /* used in all msg routines */ -extern int server; /* true if we are the server */ +extern int isserver; /* true if we are the server */ extern int protver; /* protocol version of partner */ #else /* MSGSUBR */ @@ -121,7 +121,7 @@ #endif /* MSGFILE */ /* used in all msg routines */ -EXTERN int server; /* true if we are the server */ +EXTERN int isserver; /* true if we are the server */ /* msggoaway */ EXTERN char *goawayreason; /* reason for goaway */