-/* Copyright (C) 1990 Transarc Corporation - All rights reserved */
/*
- * (C) COPYRIGHT IBM CORPORATION 1987, 1988
- * LICENSED MATERIALS - PROPERTY OF IBM
+ * Copyright 2000, International Business Machines Corporation and others.
+ * All Rights Reserved.
+ *
+ * This software has been released under the terms of the IBM Public
+ * License. For details, see the LICENSE file in the top-level source
+ * directory or online at http://www.openafs.org/dl/license10.html
*/
+#include <afsconfig.h>
#include <afs/param.h>
+
+RCSID("$Header$");
+
#include <afs/stds.h>
#ifdef AFS_AIX32_ENV
#include <signal.h>
#include <sys/time.h>
#include <dirent.h>
#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
#include <stdio.h>
#include <errno.h>
#include <rx/xdr.h>
#include <afs/cellconfig.h>
#include <afs/afsutil.h>
#include <afs/fileutil.h>
-
#include "update.h"
#include "global.h"
-
char *whoami;
static int verbose;
printf("host %s not found \n", aname);
exit(1);
}
- bcopy(th->h_addr, &addr, sizeof(addr));
+ memcpy(&addr, th->h_addr, sizeof(addr));
return addr;
}
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);
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;
}
mode, atime, time);
if (errcode == 1) /* this file failed, but keep trying */
goto fail_dirbuf;
- if (errcode == -1) /* time to quit */
+ if (errcode == -1) /* time to quit */ {
+ fclose(stream);
+ unlink(dirbuf);
return -1;
+ }
}
}
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,"/");
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;
}
return 0;
}
+int
FetchFile(call, remoteFile, localFile, dirFlag)
struct rx_call *call;
char *localFile, *remoteFile;
{
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
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) {
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;
}
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;
}
/* 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);
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;