From: Nathan Neulinger Date: Sat, 23 Jun 2001 17:31:36 +0000 (+0000) Subject: convert-update-to-afsconfig-and-kill-warnings-20010623 X-Git-Tag: openafs-stable-1_1_0~93 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=7e00ffc70a57bc926c45056b350933d3ab2f9d83;p=packages%2Fo%2Fopenafs.git convert-update-to-afsconfig-and-kill-warnings-20010623 convert upserver and upclient to use afsconfig and kill warnings --- diff --git a/src/update/Makefile b/src/update/Makefile index 19d6b921d..b4b45ec3c 100644 --- a/src/update/Makefile +++ b/src/update/Makefile @@ -14,7 +14,7 @@ LIBS = ${SRCDIR}lib/afs/libauth.a ${SRCDIR}lib/librxkad.a \ ${SRCDIR}lib/libdes.a ${LIBRX} ${SRCDIR}lib/liblwp.a \ ${SRCDIR}lib/afs/libcom_err.a ${SRCDIR}lib/afs/util.a \ ${SRCDIR}lib/afs/libsys.a -CFLAGS= ${DBUG} -I${SRCDIR}include ${XCFLAGS} +CFLAGS= ${DBUG} -I${SRCDIR}include -I${TOP_SRCDIR}/config ${XCFLAGS} PROGS=upclient upserver diff --git a/src/update/client.c b/src/update/client.c index 3bf09f55d..a90f9566f 100644 --- a/src/update/client.c +++ b/src/update/client.c @@ -8,6 +8,7 @@ */ #include +#include #include #ifdef AFS_AIX32_ENV #include @@ -31,6 +32,15 @@ #include #include #endif +#ifdef HAVE_STRINGS_H +#include +#endif +#ifdef HAVE_STRING_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif #include #include #include @@ -41,6 +51,8 @@ #include #include +RCSID("$Header$"); + #include "update.h" #include "global.h" @@ -223,7 +235,6 @@ again: while(1){/*keep doing it */ char c, c1; for(df = dirname; df; df=df->next) { /*for each directory do */ - afs_int32 isDir = 0; char *curDir; if (verbose) printf ("Checking dir %s\n", df->name); @@ -232,7 +243,7 @@ again: ZapList(&okhostfiles); /* construct local path from canonical (wire-format) path */ - if (errcode = ConstructLocalPath(df->name, "/", &curDir)) { + if ((errcode = ConstructLocalPath(df->name, "/", &curDir))) { com_err(whoami, errcode, "Unable to construct local path"); return errcode; } @@ -323,7 +334,7 @@ again: goto fail; } - while(dp = readdir(dirp)) { + while((dp = readdir(dirp))) { /* for all the files in the directory df->name do*/ strcpy(filename, curDir); strcat(filename,"/"); @@ -377,7 +388,7 @@ afs_int32 time, length; char *localname; /* construct a local path from canonical (wire-format) path */ - if (error = ConstructLocalPath(filename, "/", &localname) ) { + if ((error = ConstructLocalPath(filename, "/", &localname))) { com_err(whoami, error, "Unable to construct local path"); return error; } @@ -393,6 +404,7 @@ afs_int32 time, length; return 0; } +int FetchFile(call, remoteFile, localFile, dirFlag) struct rx_call *call; char *localFile, *remoteFile; @@ -436,7 +448,9 @@ int update_ReceiveFile(fd, call, status) { register char *buffer = (char*) 0; afs_int32 length; +#ifdef notdef XDR xdr; +#endif register int blockSize; afs_int32 error = 0, len; #ifdef AFS_AIX_ENV @@ -467,7 +481,7 @@ int update_ReceiveFile(fd, call, status) return UPDATE_ERROR; } while (!error && length) { - register nbytes = (length>blockSize?blockSize:length); + register int nbytes = (length>blockSize?blockSize:length); nbytes = rx_Read(call, buffer, nbytes); if (!nbytes) error = UPDATE_ERROR; if (write(fd, buffer, nbytes) != nbytes) { @@ -552,7 +566,7 @@ int NotOnHost(filename, okhostfiles) for(tf=okhostfiles; tf; tf=tf->next) { /* construct local path from canonical (wire-format) path */ - if (rc = ConstructLocalPath(tf->name, "/", &hostfile)) { + if ((rc = ConstructLocalPath(tf->name, "/", &hostfile))) { com_err(whoami, rc, "Unable to construct local path"); return -1; } @@ -578,7 +592,7 @@ static int RenameNewFiles(struct filestr *modFiles) for(tf = modFiles; tf; tf=tf->next) { /* construct local path from canonical (wire-format) path */ - if (errcode = ConstructLocalPath(tf->name, "/", &fname)) { + if ((errcode = ConstructLocalPath(tf->name, "/", &fname))) { com_err(whoami, errcode, "Unable to construct local path"); return errcode; } @@ -652,7 +666,8 @@ int GetFileFromUpServer(struct rx_connection *conn, /* handle for upserver */ /* now set the rest of the file status */ errcode = chmod(newfile, mode); if(errcode){ - printf("could not change protection on %s to %u\n",newfile, mode); + printf("could not change protection on %s to %u\n",newfile, + (unsigned int) mode); com_err (whoami, errno, "could not change protection on %s to %u", newfile, mode); @@ -676,7 +691,7 @@ int GetFileFromUpServer(struct rx_connection *conn, /* handle for upserver */ errcode = utimes(newfile, tvp); #endif /* NT40 */ if (errcode) { - printf("could not change access and modify times on %s to %u %u\n",newfile, atime, mtime); + printf("could not change access and modify times on %s to %u %u\n",newfile, (unsigned int) atime, (unsigned int) mtime); com_err (whoami, errno, "could not change access and modify times on %s to %u %u",newfile, atime, mtime); return 1; diff --git a/src/update/server.c b/src/update/server.c index 88b140979..bf584a7fe 100644 --- a/src/update/server.c +++ b/src/update/server.c @@ -8,6 +8,7 @@ */ #include +#include #include #ifdef AFS_AIX32_ENV #include @@ -26,6 +27,15 @@ #include #include #endif +#ifdef HAVE_STRING_H +#include +#endif +#ifdef HAVE_STRINGS_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif #include #include #include @@ -36,11 +46,13 @@ #include #include +RCSID("$Header$"); + #include "update.h" #include "global.h" -extern UPDATE_ExecuteRequest(); +extern int UPDATE_ExecuteRequest(); static int AddObject(char **expPath, char *dir); static int PathInDirectory(char *dir, char *path); @@ -50,7 +62,7 @@ char *dirName[MAXENTRIES]; int dirLevel[MAXENTRIES]; char *whoami; -static Quit(); +static int Quit(); /* check whether caller is authorized to manage RX statistics */ int update_rxstat_userok(call) @@ -166,7 +178,7 @@ int main (argc, argv) extern struct rx_securityClass *rxnull_NewServerSecurityObject(); extern afs_int32 afsconf_GetKey(); - int a; + int a = 0; rxkad_level level; rxkad_level newLevel; @@ -215,10 +227,8 @@ int main (argc, argv) for (a=1; a struct statfs tstatfs; @@ -403,7 +416,7 @@ register struct stat *status; rx_Write(call, &tlen, sizeof(afs_int32)); /* send length on fetch */ #endif while (!error && length) { - register nbytes = (length>blockSize?blockSize:length); + register int nbytes = (length>blockSize?blockSize:length); nbytes = read(fd, buffer, nbytes); if (nbytes <= 0) { fprintf(stderr, "File system read failed\n"); @@ -440,7 +453,7 @@ char *origDir; /* orig name of dir before being localized */ if (!stream) { error = EIO; } else { - while(dp = readdir(dirp)){ + while((dp = readdir(dirp))){ strcpy(filename, name); strcat(filename,"/"); strcat(filename,dp->d_name); @@ -456,7 +469,13 @@ char *origDir; /* orig name of dir before being localized */ strcpy(dirEntry, origDir); strcat(dirEntry, "/"); strcat(dirEntry, dp->d_name); - err = fprintf(stream, "\"%s\" %u %u %u %u %u %u\n", dirEntry, tstatus.st_mtime,tstatus.st_size,tstatus.st_mode,tstatus.st_uid,tstatus.st_gid, tstatus.st_atime); + err = fprintf(stream, "\"%s\" %u %u %u %u %u %u\n", dirEntry, + (unsigned int) tstatus.st_mtime, + (unsigned int) tstatus.st_size, + tstatus.st_mode, + tstatus.st_uid, + tstatus.st_gid, + (unsigned int) tstatus.st_atime); if (err < 0) error = EIO; } err = close(tfd); @@ -502,7 +521,7 @@ static int AddObject(char **expPath, char *dir) struct stat statbuf; /* construct a local path from a canonical (wire-format) path */ - if ( error = ConstructLocalPath(dir, "/", expPath) ) { + if ((error = ConstructLocalPath(dir, "/", expPath))) { com_err(whoami, error, "Unable to construct local path"); return error; } diff --git a/src/update/utils.c b/src/update/utils.c index 443cbe770..5573eddf8 100644 --- a/src/update/utils.c +++ b/src/update/utils.c @@ -8,6 +8,7 @@ */ #include +#include #include #include #include "global.h" @@ -17,8 +18,20 @@ #include #endif #include +#ifdef HAVE_STRING_H +#include +#endif +#ifdef HAVE_STRINGS_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif +#include +RCSID("$Header$"); +int AddToList(ah, aname) struct filestr **ah; char *aname; { @@ -31,6 +44,7 @@ char *aname; { return 0; } +int ZapList(ah) struct filestr **ah; { register struct filestr *tf, *nf;