convert-from-bsd-to-posix-string-and-memory-functions-20010807

bcopy, bcmp, bzero, index, rindex, you're all cut.
memcpy, memcmp, memset, strchr, strrchr, show us how it's done

====================
This delta was composed from multiple commits as part of the CVS->Git migration.
The checkin message with each commit was inconsistent.
The following are the additional commit messages.
====================

fix reference to memset the right thing

====================

make change to arguments globally and not just for e.g. linux/darwin/fbsd

====================

fix a minor flub in how this was done

====================

correct another bad memcpy coversion

====================

fix up more inadvertant turds

====================

fix two errors found by chas williams
This commit is contained in:
Derrick Brashear 2001-08-08 03:05:55 +00:00
parent 81c5741633
commit c5c521af0e
335 changed files with 1535 additions and 1646 deletions

View File

@ -425,7 +425,7 @@ int SRXAFSCB_GetCellServDB(
t_name = (char *)malloc(AFSNAMEMAX);
t_name[0] = '\0';
*a_name = t_name;
bzero(a_hosts, AFSMAXCELLHOSTS * sizeof(afs_int32));
memset(a_hosts, 0, AFSMAXCELLHOSTS * sizeof(afs_int32));
return 0;
}

View File

@ -2664,7 +2664,7 @@ static afs_int32 GetCryptCmd(as)
if (code) Die(code, (char *) 0);
else {
tp = space;
bcopy(tp, &flag, sizeof(afs_int32));
memcpy(&flag, tp, sizeof(afs_int32));
printf("Security level is currently ");
if (flag == 1)
printf("crypt (data security).\n");

View File

@ -175,7 +175,7 @@ typedef struct ktext KTEXT_ST;
swab(((char *) x) +10,((char *) _krb_swap_tmp) +4 ,2); \
swab(((char *) x) +12,((char *) _krb_swap_tmp) +2 ,2); \
swab(((char *) x) +14,((char *) _krb_swap_tmp) +0 ,2); \
bcopy((char *)_krb_swap_tmp,(char *)x,16);\
memcpy((char *)x, (char *)_krb_swap_tmp, 16);\
}
#define swap_u_12(x) {\
@ -186,7 +186,7 @@ typedef struct ktext KTEXT_ST;
swab(((char *) x) +6, ((char *) _krb_swap_tmp) +4 ,2); \
swab(((char *) x) +8, ((char *) _krb_swap_tmp) +2 ,2); \
swab(((char *) x) +10,((char *) _krb_swap_tmp) +0 ,2); \
bcopy((char *)_krb_swap_tmp,(char *)x,12);\
memcpy((char *)x, (char *)_krb_swap_tmp, 12);\
}
#define swap_C_Block(x) {\
@ -195,7 +195,7 @@ typedef struct ktext KTEXT_ST;
swab(((char *) x) +2,((char *) _krb_swap_tmp) +4 ,2); \
swab(((char *) x) +4,((char *) _krb_swap_tmp) +2 ,2); \
swab(((char *) x) +6,((char *) _krb_swap_tmp) ,2); \
bcopy((char *)_krb_swap_tmp,(char *)x,8);\
memcpy((char *)x, (char *)_krb_swap_tmp, 8);\
}
#define swap_u_quad(x) {\
unsigned long _krb_swap_tmp[4];\
@ -203,7 +203,7 @@ typedef struct ktext KTEXT_ST;
swab(((char *) &x) +2,((char *) _krb_swap_tmp) +4 ,2); \
swab(((char *) &x) +4,((char *) _krb_swap_tmp) +2 ,2); \
swab(((char *) &x) +6,((char *) _krb_swap_tmp) ,2); \
bcopy((char *)_krb_swap_tmp,(char *)&x,8);\
memcpy((char *)&x, (char *)_krb_swap_tmp, 8);\
}
#define swap_u_long(x) {\

View File

@ -40,7 +40,7 @@ void *osi_UFSOpen(ainode)
}
if (!afs_osicred_initialized) {
/* valid for alpha_osf, SunOS, Ultrix */
bzero((char *)&afs_osi_cred, sizeof(struct AFS_UCRED));
memset((char *)&afs_osi_cred, 0, sizeof(struct AFS_UCRED));
crhold(&afs_osi_cred); /* don't let it evaporate, since it is static */
afs_osicred_initialized = 1;
}

View File

@ -233,7 +233,7 @@ int timeoutcf(
break;
}
else {
bzero(tos, sizeof(struct tos));
memset(tos, 0, sizeof(struct tos));
}
/* The trb and the tos were both allocated. */

View File

@ -735,7 +735,7 @@ struct ucred *cred;
AFS_STATCNT(afs_gn_fclear);
if (!fclear_init) {
bzero(zero_buffer, PAGESIZE);
memset(zero_buffer, 0, PAGESIZE);
fclear_init = 1;
}
/*

View File

@ -106,7 +106,7 @@ void *osi_UFSOpen(ainode)
}
if (!afs_osicred_initialized) {
/* valid for alpha_osf, SunOS, Ultrix */
bzero((char *)&afs_osi_cred, sizeof(struct AFS_UCRED));
memset((char *)&afs_osi_cred, 0, sizeof(struct AFS_UCRED));
afs_osi_cred.cr_ref++;
afs_osi_cred.cr_ngroups=1;
afs_osicred_initialized = 1;

View File

@ -23,7 +23,7 @@ kern_return_t afs_modload(struct kmod_info *ki, void *data)
printf("AFS_SYSCALL in use. aborting\n");
return KERN_FAILURE;
}
bzero(&afs_vfsconf, sizeof(struct vfsconf));
memset(&afs_vfsconf, 0, sizeof(struct vfsconf));
strcpy(afs_vfsconf.vfc_name, "afs");
afs_vfsconf.vfc_vfsops=&afs_vfsops;
afs_vfsconf.vfc_typenum=VT_AFS;

View File

@ -78,8 +78,8 @@ struct proc *p;
mp->mnt_stat.f_iosize=8192;
(void) copyinstr(path, mp->mnt_stat.f_mntonname, MNAMELEN-1, &size);
bzero(mp->mnt_stat.f_mntonname + size, MNAMELEN - size);
bzero(mp->mnt_stat.f_mntfromname, MNAMELEN);
memset(mp->mnt_stat.f_mntonname + size, 0, MNAMELEN - size);
memset(mp->mnt_stat.f_mntfromname, 0, MNAMELEN);
strcpy(mp->mnt_stat.f_mntfromname, "AFS");
/* null terminated string "AFS" will fit, just leave it be. */
strcpy(mp->mnt_stat.f_fstypename, "afs");
@ -191,10 +191,8 @@ int afs_statfs(struct mount *mp, struct statfs *abp, struct proc *p)
abp->f_fsid.val[1] = mp->mnt_stat.f_fsid.val[1];
if (abp != &mp->mnt_stat) {
abp->f_type = mp->mnt_vfc->vfc_typenum;
bcopy((caddr_t)mp->mnt_stat.f_mntonname,
(caddr_t)&abp->f_mntonname[0], MNAMELEN);
bcopy((caddr_t)mp->mnt_stat.f_mntfromname,
(caddr_t)&abp->f_mntfromname[0], MNAMELEN);
memcpy((caddr_t)&abp->f_mntonname[0], (caddr_t)mp->mnt_stat.f_mntonname, MNAMELEN);
memcpy((caddr_t)&abp->f_mntfromname[0], (caddr_t)mp->mnt_stat.f_mntfromname, MNAMELEN);
}
AFS_GUNLOCK();
@ -227,7 +225,7 @@ int afs_init(struct vfsconf *vfc) {
MALLOC(afs_vnodeop_p, PFI *, vfs_opv_numops*sizeof(PFI), M_TEMP, M_WAITOK);
bzero (afs_vnodeop_p, vfs_opv_numops*sizeof(PFI));
memset(afs_vnodeop_p, 0, vfs_opv_numops*sizeof(PFI));
opv_desc_vector = afs_vnodeop_p;
for (j=0; afs_vnodeop_opv_desc.opv_desc_ops[j].opve_op; j++) {

View File

@ -121,7 +121,7 @@ struct vnodeopv_desc afs_vnodeop_opv_desc =
struct componentname *cnp = ap->a_cnp; \
char *name; \
MALLOC(name, char *, cnp->cn_namelen+1, M_TEMP, M_WAITOK); \
bcopy(cnp->cn_nameptr, name, cnp->cn_namelen); \
memcpy(name, cnp->cn_nameptr, cnp->cn_namelen); \
name[cnp->cn_namelen] = '\0'
#define DROPNAME() FREE(name, M_TEMP)
@ -604,7 +604,7 @@ afs_vop_pageout(ap)
if ((f_offset < tvc->m.Length) && (f_offset + size) > tvc->m.Length) {
size_t io = tvc->m.Length - f_offset;
bzero((caddr_t)(ioaddr + pl_offset + io), size - io);
memset((caddr_t)(ioaddr + pl_offset + io), 0, size - io);
}
}
#endif /* ] USV */
@ -888,10 +888,10 @@ abortit:
goto abortit;
MALLOC(fname, char *, fcnp->cn_namelen+1, M_TEMP, M_WAITOK);
bcopy(fcnp->cn_nameptr, fname, fcnp->cn_namelen);
memcpy(fname, fcnp->cn_nameptr, fcnp->cn_namelen);
fname[fcnp->cn_namelen] = '\0';
MALLOC(tname, char *, tcnp->cn_namelen+1, M_TEMP, M_WAITOK);
bcopy(tcnp->cn_nameptr, tname, tcnp->cn_namelen);
memcpy(tname, tcnp->cn_nameptr, tcnp->cn_namelen);
tname[tcnp->cn_namelen] = '\0';

View File

@ -60,7 +60,7 @@ void *osi_UFSOpen(ainode)
struct utask_nd utnd = { NULL, NULL };
struct vattr attr;
bzero(&nd, sizeof(nd));
memset(&nd, 0, sizeof(nd));
ndp->ni_utnd = &utnd;
ndp->ni_nameiop = LOOKUP;
ndp->ni_cred = &afs_osi_cred;

View File

@ -90,10 +90,10 @@ int mp_afs_mount(struct mount *afsp,char * path, caddr_t data,
if ( !afsp->m_stat.f_mntonname || !afsp->m_stat.f_mntfromname)
panic("malloc failure in afs_mount\n");
bzero(afsp->m_stat.f_mntonname, MNAMELEN);
bzero(afsp->m_stat.f_mntfromname, MNAMELEN);
memset(afsp->m_stat.f_mntonname, 0, MNAMELEN);
memset(afsp->m_stat.f_mntfromname, 0, MNAMELEN);
AFS_COPYINSTR(path, (caddr_t)afsp->m_stat.f_mntonname, MNAMELEN, &size, code);
bcopy("AFS", afsp->m_stat.f_mntfromname, 4);
memcpy(afsp->m_stat.f_mntfromname, "AFS", 4);
AFS_GUNLOCK();
(void) mp_afs_statfs(afsp);
AFS_GLOCK();
@ -307,12 +307,12 @@ int mp_afs_vptofh(struct vnode *avn, struct fid *fidp)
fidp->fid_len = AFS_SIZEOFSMALLFID;
if (afs_NFSRootOnly) {
if (rootvp) {
bcopy((caddr_t)&Sfid, fidp->fid_data, AFS_FIDDATASIZE);
memcpy(fidp->fid_data, (caddr_t)&Sfid, AFS_FIDDATASIZE);
} else {
bcopy((caddr_t)addr, fidp->fid_data, AFS_FIDDATASIZE);
memcpy(fidp->fid_data, (caddr_t)addr, AFS_FIDDATASIZE);
}
} else {
bcopy((caddr_t)&Sfid, fidp->fid_data, AFS_FIDDATASIZE);
memcpy(fidp->fid_data, (caddr_t)&Sfid, AFS_FIDDATASIZE);
}
AFS_GUNLOCK();
return 0;

View File

@ -38,7 +38,7 @@ void *osi_UFSOpen(ainode)
}
if (!afs_osicred_initialized) {
/* valid for alpha_osf, SunOS, Ultrix */
bzero((char *)&afs_osi_cred, sizeof(struct AFS_UCRED));
memset((char *)&afs_osi_cred, 0, sizeof(struct AFS_UCRED));
afs_osi_cred.cr_ref++;
afs_osicred_initialized = 1;
}

View File

@ -90,10 +90,10 @@ int mp_afs_mount(struct mount *afsp,char * path, caddr_t data,
if ( !afsp->m_stat.f_mntonname || !afsp->m_stat.f_mntfromname)
panic("malloc failure in afs_mount\n");
bzero(afsp->m_stat.f_mntonname, MNAMELEN);
bzero(afsp->m_stat.f_mntfromname, MNAMELEN);
memset(afsp->m_stat.f_mntonname, 0, MNAMELEN);
memset(afsp->m_stat.f_mntfromname, 0, MNAMELEN);
AFS_COPYINSTR(path, (caddr_t)afsp->m_stat.f_mntonname, MNAMELEN, &size, code);
bcopy("AFS", afsp->m_stat.f_mntfromname, 4);
memcpy(afsp->m_stat.f_mntfromname, "AFS", 4);
AFS_GUNLOCK();
(void) mp_afs_statfs(afsp);
AFS_GLOCK();
@ -299,12 +299,12 @@ int mp_afs_vptofh(struct vnode *avn, struct fid *fidp)
fidp->fid_len = AFS_SIZEOFSMALLFID;
if (afs_NFSRootOnly) {
if (rootvp) {
bcopy((caddr_t)&Sfid, fidp->fid_data, AFS_FIDDATASIZE);
memcpy(fidp->fid_data, (caddr_t)&Sfid, AFS_FIDDATASIZE);
} else {
bcopy((caddr_t)addr, fidp->fid_data, AFS_FIDDATASIZE);
memcpy(fidp->fid_data, (caddr_t)addr, AFS_FIDDATASIZE);
}
} else {
bcopy((caddr_t)&Sfid, fidp->fid_data, AFS_FIDDATASIZE);
memcpy(fidp->fid_data, (caddr_t)&Sfid, AFS_FIDDATASIZE);
}
AFS_GUNLOCK();
return 0;

View File

@ -39,7 +39,7 @@ void *osi_UFSOpen(ainode)
}
if (!afs_osicred_initialized) {
/* valid for alpha_osf, SunOS, Ultrix */
bzero((char *)&afs_osi_cred, sizeof(struct AFS_UCRED));
memset((char *)&afs_osi_cred, 0, sizeof(struct AFS_UCRED));
crhold(&afs_osi_cred); /* don't let it evaporate, since it is static */
afs_osicred_initialized = 1;
}

View File

@ -77,14 +77,14 @@ m_cpytoc(m, off, len, cp)
return (len);
ml = MIN(len, m->m_len - off);
bcopy(mtod(m, caddr_t)+off, cp, (u_int)ml);
memcpy(cp, mtod(m, caddr_t)+off, (u_int)ml);
cp += ml;
len -= ml;
m = m->m_next;
while (len && m) {
ml = m->m_len;
bcopy(mtod(m, caddr_t), cp, (u_int)ml);
memcpy(cp, mtod(m, caddr_t), (u_int)ml);
cp += ml;
len -= ml;
m = m->m_next;
@ -1350,7 +1350,7 @@ afs_pageout(vp,prp, start, end, flags)
filevp = VM_GET_PAGEOUT_VNODE(&vm_info); /* always page out to back store */
VASSERT(filevp != NULL);
bzero((caddr_t)&args, sizeof(fsdata_t));
memset((caddr_t)&args, 0, sizeof(fsdata_t));
args.remote_down = 0; /* assume remote file servers are up */
args.remote = 1; /* we are remote */
args.bsize = 0; /* filled up later by afs_vm_checkpage() */
@ -2039,7 +2039,7 @@ afs_readdir(vp, uiop, cred)
if ((caddr_t) odp + odp->d_reclen > obufend)
break;
/* record offset *after* we're sure to use this entry */
bcopy((char *)&idp->__d_off, (char *)&tmp_offset, sizeof tmp_offset);
memcpy((char *)&tmp_offset, (char *)&idp->__d_off, sizeof tmp_offset);
offset = tmp_offset;
}
@ -2098,7 +2098,7 @@ afs_readdir3(vp, uiop, cred)
(caddr_t)idp < ibufend;
idp = (struct __dirent32 *) ((caddr_t) idp + idp->__d_reclen),
odp = (struct __dirent64 *) ((caddr_t) odp + odp->__d_reclen)) {
bcopy((char *)&idp->__d_off, (char *)&odp->__d_off, sizeof odp->__d_off);
memcpy((char *)&odp->__d_off, (char *)&idp->__d_off, sizeof odp->__d_off);
odp->__d_ino = idp->__d_ino;
odp->__d_namlen = idp->__d_namlen;
(void) strcpy(odp->__d_name, idp->__d_name);
@ -2223,7 +2223,7 @@ printf("afsHash: enter\n");
osi_Panic("afs: cannot create SEMA Hashtable\n");
/* initialize the hash table and associated locks */
bzero((char *)hashTable, sizeOfHashTable * sizeof(Bucket ));
memset((char *)hashTable, 0, sizeOfHashTable * sizeof(Bucket ));
for ( i=0;i < sizeOfHashTable; i ++)
hashLockInit( hashTable[i].lock);
hashLockInit(afsHashLock);
@ -2289,7 +2289,7 @@ printf("afsHashInsertFind: %d FOUND\n", key);
osi_Panic("afs: SEMA Hashtable cannot create new entry\n");
/* create new entry */
ptr->key = key;
bzero((char *)&ptr->element, sizeof(ptr->element));
memset((char *)&ptr->element, 0, sizeof(ptr->element));
ptr->refCnt = 1; /* this guy */
/* insert new entry in bucket */

View File

@ -74,7 +74,7 @@ void *osi_UFSOpen(ino_t ainode)
}
if (!afs_osicred_initialized) {
/* valid for alpha_osf, SunOS, Ultrix */
bzero((char *)&afs_osi_cred, sizeof(struct AFS_UCRED));
memset((char *)&afs_osi_cred, 0, sizeof(struct AFS_UCRED));
crhold(&afs_osi_cred); /* don't let it evaporate, since it is static */
afs_osicred_initialized = 1;
}

View File

@ -89,7 +89,7 @@ int fixup_pags(int **credpp, int ngroups, gid_t *gidset, int old_afs_pag,
return EINVAL; /* sorry */
cr = crdup(OSI_GET_CURRENT_CRED()); /* we will replace all the groups. */
bzero((char*)&cr->cr_groups, ngroups_max * sizeof(gid_t));
memset((char*)&cr->cr_groups, 0, ngroups_max * sizeof(gid_t));
/* Now cobble the new groups list together. */
new = 0;

View File

@ -460,7 +460,7 @@ xfs_icreatename64(struct vfs *vfsp, int datap, int datalen,
}
else
createdDir = 1;
bzero((char*)&dattr, sizeof(dattr));
memset((char*)&dattr, 0, sizeof(dattr));
dattr.atd_version = AFS_XFS_ATD_VERS;
dattr.atd_volume = rw_vno;
AFS_VOP_ATTR_SET(dvp, AFS_XFS_DATTR, (char*)&dattr,
@ -482,7 +482,7 @@ xfs_icreatename64(struct vfs *vfsp, int datap, int datalen,
return code;
}
bzero((char*)&attrs, sizeof(attrs));
memset((char*)&attrs, 0, sizeof(attrs));
attrs.at_pino = vattr.va_nodeid;
VN_RELE(dvp);
@ -510,8 +510,7 @@ xfs_icreatename64(struct vfs *vfsp, int datap, int datalen,
if (!code) {
/* Set attributes. */
bcopy((char*)params, (char*)attrs.at_param,
sizeof(afs_inode_params_t));
memcpy((char*)attrs.at_param, (char*)params, sizeof(afs_inode_params_t));
attrs.at_attr_version = AFS_XFS_ATTR_VERS;
attrs.at_name_version = name_version;
AFS_VOP_ATTR_SET(vp, AFS_XFS_ATTR, (char*)&attrs,
@ -1200,12 +1199,11 @@ afs_syscall_ilistinode64(int dev, int inode_hi, int inode_lo,
}
if (!code) {
bzero((char*)&data, sizeof(data));
memset((char*)&data, 0, sizeof(data));
data.ili_info.inodeNumber = inode;
data.ili_info.byteCount = vattr.va_size;
data.ili_info.linkCount = (vattr.va_mode & AFS_XFS_MODE_LINK_MASK);
bcopy((char*)attrs.at_param, (char*)data.ili_info.param,
sizeof(data.ili_info.param));
memcpy((char*)data.ili_info.param, (char*)attrs.at_param, sizeof(data.ili_info.param));
data.ili_attr_version = attrs.at_attr_version;
data.ili_name_version = attrs.at_name_version;
data.ili_tag = attrs.at_tag;

View File

@ -810,7 +810,7 @@ afs_strategy(OSI_VC_ARG(avc), bp)
/* we are responsible for zero'ing the page */
caddr_t c;
c = bp_mapin(bp);
bzero(c, bp->b_bcount);
memset(c, 0, bp->b_bcount);
iodone(bp);
ReleaseReadLock(&avc->lock);
return;

View File

@ -40,7 +40,7 @@ void *osi_UFSOpen(ainode)
}
if (!afs_osicred_initialized) {
/* valid for alpha_osf, SunOS, Ultrix */
bzero((char *)&afs_osi_cred, sizeof(struct AFS_UCRED));
memset((char *)&afs_osi_cred, 0, sizeof(struct AFS_UCRED));
crhold(&afs_osi_cred); /* don't let it evaporate, since it is static */
afs_osicred_initialized = 1;
}

View File

@ -59,9 +59,11 @@ extern struct vnodeops afs_dir_iops, afs_symlink_iops;
((vc)->v_op == &afs_dir_iops) ? 1 : \
((vc)->v_op == &afs_symlink_iops))
/* bcopy is in stds.h, just so fcrpyt.c can pick it up. */
#if 0
/* bcopy is in stds.h, just so fcrypt.c can pick it up. */
#define bzero(D,C) memset((D), 0, (C))
#define bcmp(A,B,C) memcmp((A), (B), (C))
#endif
/* We often need to pretend we're in user space to get memory transfers
* right for the kernel calls we use.

View File

@ -189,7 +189,7 @@ void *osi_UFSOpen(ainode)
}
if (!afs_osicred_initialized) {
/* valid for alpha_osf, SunOS, Ultrix */
bzero((char *)&afs_osi_cred, sizeof(struct AFS_UCRED));
memset((char *)&afs_osi_cred, 0, sizeof(struct AFS_UCRED));
crhold(&afs_osi_cred); /* don't let it evaporate, since it is static */
afs_osicred_initialized = 1;
}

View File

@ -1419,7 +1419,7 @@ struct afsconf_dir *adir; {
/* build address list */
for(i=0;i<MAXHOSTSPERCELL;i++)
bcopy(&aci->hostAddr[i].sin_addr, &hosts[i], sizeof(afs_int32));
memcpy(&hosts[i], &aci->hostAddr[i].sin_addr, sizeof(afs_int32));
if (aci->linkedCell) cellFlags |= 4; /* Flag that linkedCell arg exists,
for upwards compatibility */
@ -1649,7 +1649,7 @@ void uafs_Init(
rn, cacheFiles);
exit(1);
}
bzero(pathname_for_V, (cacheFiles * sizeof(char *)));
memset(pathname_for_V, 0, (cacheFiles * sizeof(char *)));
if (afsd_debug)
printf("%s: %d pathname_for_V entries at 0x%x, %d bytes\n",
rn, cacheFiles, (cacheFiles * sizeof(AFSD_INO_T)));
@ -1747,7 +1747,7 @@ void uafs_Init(
" flags = 0x%x, dcache entries %d\n",
rn, cacheStatEntries, cacheFiles, cacheBlocks, cacheFlags,
dCacheSize);
bzero(&cparams, sizeof(cparams));
memset(&cparams, 0, sizeof(cparams));
cparams.cacheScaches = cacheStatEntries;
cparams.cacheFiles = cacheFiles;
cparams.cacheBlocks = cacheBlocks;

View File

@ -130,12 +130,12 @@ struct fid **fidpp;
|| USE_SMALLFID(credp)
#endif
) {
bcopy((caddr_t)&Sfid, fidpp->fid_data, SizeOfSmallFid);
memcpy(fidpp->fid_data, (caddr_t)&Sfid, SizeOfSmallFid);
} else {
bcopy((caddr_t)addr, fidpp->fid_data, SizeOfSmallFid);
memcpy(fidpp->fid_data, (caddr_t)addr, SizeOfSmallFid);
}
} else {
bcopy((caddr_t)&Sfid, fidpp->fid_data, SizeOfSmallFid);
memcpy(fidpp->fid_data, (caddr_t)&Sfid, SizeOfSmallFid);
}
#else
/* malloc a fid pointer ourselves. */
@ -143,12 +143,12 @@ struct fid **fidpp;
(*fidpp)->fid_len = SizeOfSmallFid;
if (afs_NFSRootOnly) {
if (rootvp) {
bcopy((char *)&Sfid, (*fidpp)->fid_data, SizeOfSmallFid);
memcpy((*fidpp)->fid_data, (char *)&Sfid, SizeOfSmallFid);
} else {
bcopy((char *)addr, (*fidpp)->fid_data, SizeOfSmallFid);
memcpy((*fidpp)->fid_data, (char *)addr, SizeOfSmallFid);
}
} else {
bcopy((char *)&Sfid, (*fidpp)->fid_data, SizeOfSmallFid);
memcpy((*fidpp)->fid_data, (char *)&Sfid, SizeOfSmallFid);
}
#endif
return (0);

View File

@ -562,8 +562,7 @@ tagain:
* preserve the value of the file size. We could
* flush the pages, but it wouldn't be worthwhile.
*/
bcopy((char *) &tfid.Fid, (char *)(fidsp+fidIndex),
sizeof(*fidsp));
memcpy((char *)(fidsp+fidIndex), (char *) &tfid.Fid, sizeof(*fidsp));
tvcp->states |= CBulkFetching;
tvcp->m.Length = statSeqNo;
fidIndex++;
@ -897,7 +896,7 @@ afs_lookup(adp, aname, avcp, acred)
AFS_STATCNT(afs_lookup);
#ifdef AFS_OSF_ENV
ndp->ni_dvp = (struct vnode *)adp;
bcopy(ndp->ni_ptr, aname, ndp->ni_namelen);
memcpy(aname, ndp->ni_ptr, ndp->ni_namelen);
aname[ndp->ni_namelen] = '\0';
#endif /* AFS_OSF_ENV */

View File

@ -104,9 +104,9 @@ afs_ustrategy(abp)
if (code == 0) {
if (tuio.afsio_resid > 0)
#if defined(AFS_FBSD_ENV)
bzero(abp->b_saveaddr + abp->b_bcount - tuio.afsio_resid, tuio.afsio_resid);
memset(abp->b_saveaddr + abp->b_bcount - tuio.afsio_resid, 0, tuio.afsio_resid);
#else
bzero(abp->b_un.b_addr + abp->b_bcount - tuio.afsio_resid, tuio.afsio_resid);
memset(abp->b_un.b_addr + abp->b_bcount - tuio.afsio_resid, 0, tuio.afsio_resid);
#endif /* AFS_FBSD_ENV */
#ifdef AFS_AIX32_ENV
/*

View File

@ -536,6 +536,6 @@ void shutdown_bufferpackage() {
nbuffers = 0;
timecounter = 1;
for(i=0;i<PHSIZE;i++) phTable[i] = 0;
bzero((char *)&afs_bufferLock, sizeof(afs_lock_t));
memset((char *)&afs_bufferLock, 0, sizeof(afs_lock_t));
}
}

View File

@ -107,7 +107,7 @@ static int afs_InitSetup(int preallocs)
afs_InitStats();
#endif /* AFS_NOSTATS */
bzero(afs_zeros, AFS_ZEROS);
memset(afs_zeros, 0, AFS_ZEROS);
/* start RX */
rx_extraPackets = AFS_NRXPACKETS; /* smaller # of packets */
@ -1251,9 +1251,9 @@ afs_shutdown()
shutdown_afstest();
/* The following hold the cm stats */
/*
bzero(&afs_cmstats, sizeof(struct afs_CMStats));
bzero(&afs_stats_cmperf, sizeof(struct afs_stats_CMPerf));
bzero(&afs_stats_cmfullperf, sizeof(struct afs_stats_CMFullPerf));
memset(&afs_cmstats, 0, sizeof(struct afs_CMStats));
memset(&afs_stats_cmperf, 0, sizeof(struct afs_stats_CMPerf));
memset(&afs_stats_cmfullperf, 0, sizeof(struct afs_stats_CMFullPerf));
*/
afs_warn(" ALL allocated tables\n");
afs_shuttingdown = 0;
@ -1922,7 +1922,7 @@ afs_icl_CreateLogWithFlags(name, logSize, flags, outLogpp)
logp = (struct afs_icl_log *)
osi_AllocSmallSpace(sizeof(struct afs_icl_log));
bzero((caddr_t)logp, sizeof(*logp));
memset((caddr_t)logp, 0, sizeof(*logp));
logp->refCount = 1;
logp->name = osi_AllocSmallSpace(strlen(name)+1);
@ -2028,8 +2028,7 @@ afs_icl_CopyOut(logp, bufferp, bufSizep, cookiep, flagsp)
if (end - ix < nwords)
nwords = end - ix;
if (nwords > 0) {
bcopy((char *) &logp->datap[ix], (char *) bufferp,
sizeof(afs_int32) * nwords);
memcpy((char *) bufferp, (char *) &logp->datap[ix], sizeof(afs_int32) * nwords);
outWords += nwords;
inWords -= nwords;
bufferp += nwords;
@ -2049,8 +2048,7 @@ afs_icl_CopyOut(logp, bufferp, bufSizep, cookiep, flagsp)
nwords = inWords;
if (logp->firstFree - ix < nwords)
nwords = logp->firstFree - ix;
bcopy((char *) &logp->datap[ix], (char *) bufferp,
sizeof(afs_int32) * nwords);
memcpy((char *) bufferp, (char *) &logp->datap[ix], sizeof(afs_int32) * nwords);
outWords += nwords;
inWords -= nwords;
bufferp += nwords;
@ -2330,7 +2328,7 @@ afs_icl_CreateSetWithFlags(name, baseLogp, fatalLogp, flags, outSetpp)
states |= ICL_SETF_PERSISTENT;
setp = (struct afs_icl_set *) afs_osi_Alloc(sizeof(struct afs_icl_set));
bzero((caddr_t)setp, sizeof(*setp));
memset((caddr_t)setp, 0, sizeof(*setp));
setp->refCount = 1;
if (states & ICL_SETF_FREED)
states &= ~ICL_SETF_ACTIVE; /* if freed, can't be active */

View File

@ -719,7 +719,7 @@ int SRXAFSCB_GetXStats(a_call, a_clientVersionNum, a_collectionNumber, a_srvVers
*/
dataBytes = sizeof(struct afs_CMStats);
dataBuffP = (afs_int32 *)afs_osi_Alloc(dataBytes);
bcopy((char *)&afs_cmstats, (char *)dataBuffP, dataBytes);
memcpy((char *)dataBuffP, (char *)&afs_cmstats, dataBytes);
a_dataP->AFSCB_CollData_len = dataBytes>>2;
a_dataP->AFSCB_CollData_val = dataBuffP;
break;
@ -739,7 +739,7 @@ int SRXAFSCB_GetXStats(a_call, a_clientVersionNum, a_collectionNumber, a_srvVers
afs_CountServers();
dataBytes = sizeof(afs_stats_cmperf);
dataBuffP = (afs_int32 *)afs_osi_Alloc(dataBytes);
bcopy((char *)&afs_stats_cmperf, (char *)dataBuffP, dataBytes);
memcpy((char *)dataBuffP, (char *)&afs_stats_cmperf, dataBytes);
a_dataP->AFSCB_CollData_len = dataBytes>>2;
a_dataP->AFSCB_CollData_val = dataBuffP;
break;
@ -757,14 +757,12 @@ int SRXAFSCB_GetXStats(a_call, a_clientVersionNum, a_collectionNumber, a_srvVers
*/
afs_stats_cmperf.numPerfCalls++;
afs_CountServers();
bcopy((char *)(&afs_stats_cmperf),
(char *)(&(afs_stats_cmfullperf.perf)),
sizeof(struct afs_stats_CMPerf));
memcpy((char *)(&(afs_stats_cmfullperf.perf)), (char *)(&afs_stats_cmperf), sizeof(struct afs_stats_CMPerf));
afs_stats_cmfullperf.numFullPerfCalls++;
dataBytes = sizeof(afs_stats_cmfullperf);
dataBuffP = (afs_int32 *)afs_osi_Alloc(dataBytes);
bcopy((char *)(&afs_stats_cmfullperf), (char *)dataBuffP, dataBytes);
memcpy((char *)dataBuffP, (char *)(&afs_stats_cmfullperf), dataBytes);
a_dataP->AFSCB_CollData_len = dataBytes>>2;
a_dataP->AFSCB_CollData_val = dataBuffP;
break;
@ -1142,7 +1140,7 @@ int SRXAFSCB_GetCellServDB(
}
t_name[0] = '\0';
bzero(a_hosts, AFSMAXCELLHOSTS * sizeof(afs_int32));
memset(a_hosts, 0, AFSMAXCELLHOSTS * sizeof(afs_int32));
/* search the list for the cell with this index */
ObtainReadLock(&afs_xcell);

View File

@ -367,7 +367,7 @@ int doLockInit;
{
register int i;
bzero((char *)cbHashT, CBHTSIZE*sizeof(struct bucket));
memset((char *)cbHashT, 0, CBHTSIZE*sizeof(struct bucket));
for (i=0;i<CBHTSIZE;i++) {
QInit(&(cbHashT[i].head));
/* Lock_Init(&(cbHashT[i].lock)); only if you want lots of locks, which

View File

@ -386,7 +386,7 @@ afs_int32 afs_NewCell(acellName, acellHosts, aflags, linkedcname, fsport, vlport
tc->states |= aflags;
tc->timeout = timeout;
bzero((char *)tc->cellHosts, sizeof(tc->cellHosts));
memset((char *)tc->cellHosts, 0, sizeof(tc->cellHosts));
for (i=0; i<MAXCELLHOSTS; i++) {
struct server *ts;
afs_uint32 temp = acellHosts[i];

View File

@ -172,7 +172,7 @@ struct conn *afs_ConnBySA(struct srvAddr *sap, unsigned short aport,
*/
UpgradeSToWLock(&afs_xconn,37);
tc = (struct conn *) afs_osi_Alloc(sizeof(struct conn));
bzero((char *)tc, sizeof(struct conn));
memset((char *)tc, 0, sizeof(struct conn));
tc->user = tu;
tc->port = aport;

View File

@ -1079,7 +1079,7 @@ afs_BioDaemon (nbiods)
/* Initialize a token (self) to use in the queue of sleeping processes. */
self = (struct afs_bioqueue *) afs_osi_Alloc (sizeof (struct afs_bioqueue));
pin (self, sizeof (struct afs_bioqueue)); /* fix in memory */
bzero(self, sizeof(*self));
memset(self, 0, sizeof(*self));
QInit (&(self->lruq)); /* initialize queue entry pointers */
@ -1200,7 +1200,7 @@ void afs_BackgroundDaemon() {
/* initialize subsystem */
if (brsInit == 0) {
LOCK_INIT(&afs_xbrs, "afs_xbrs");
bzero((char *)afs_brs, sizeof(afs_brs));
memset((char *)afs_brs, 0, sizeof(afs_brs));
brsInit = 1;
#if defined (AFS_SGI_ENV) && defined(AFS_SGI_SHORTSTACK)
/*
@ -1281,8 +1281,8 @@ void shutdown_daemons()
if (afs_cold_shutdown) {
afs_brsDaemons = brsInit = 0;
rxepoch_checked = afs_nbrs = 0;
bzero((char *)afs_brs, sizeof(afs_brs));
bzero((char *)&afs_xbrs, sizeof(afs_lock_t));
memset((char *)afs_brs, 0, sizeof(afs_brs));
memset((char *)&afs_xbrs, 0, sizeof(afs_lock_t));
afs_brsWaiters = 0;
#ifdef AFS_AIX32_ENV
#ifdef AFS_AIX41_ENV
@ -1292,7 +1292,7 @@ void shutdown_daemons()
#else /* AFS_AIX41_ENV */
afs_busyq = NULL;
afs_biodcnt = 0;
bzero((char *)&afs_bioqueue, sizeof(struct afs_bioqueue));
memset((char *)&afs_bioqueue, 0, sizeof(struct afs_bioqueue));
#endif
afs_initbiod = 0;
#endif

View File

@ -2650,18 +2650,18 @@ void afs_dcacheInit(int afiles, int ablocks, int aDentries, int achunk,
/* Allocate and zero the pointer array to the dcache entries */
afs_indexTable = (struct dcache **)
afs_osi_Alloc(sizeof(struct dcache *) * afiles);
bzero((char *)afs_indexTable, sizeof(struct dcache *) * afiles);
memset((char *)afs_indexTable, 0, sizeof(struct dcache *) * afiles);
afs_indexTimes = (afs_hyper_t *) afs_osi_Alloc(afiles * sizeof(afs_hyper_t));
bzero((char *)afs_indexTimes, afiles * sizeof(afs_hyper_t));
memset((char *)afs_indexTimes, 0, afiles * sizeof(afs_hyper_t));
afs_indexUnique = (afs_int32 *) afs_osi_Alloc(afiles * sizeof(afs_uint32));
bzero((char *)afs_indexUnique, afiles * sizeof(afs_uint32));
memset((char *)afs_indexUnique, 0, afiles * sizeof(afs_uint32));
afs_indexFlags = (u_char *) afs_osi_Alloc(afiles * sizeof(u_char));
bzero((char *)afs_indexFlags, afiles * sizeof(char));
memset((char *)afs_indexFlags, 0, afiles * sizeof(char));
/* Allocate and thread the struct dcache entries themselves */
tdp = afs_Initial_freeDSList =
(struct dcache *) afs_osi_Alloc(aDentries * sizeof(struct dcache));
bzero((char *)tdp, aDentries * sizeof(struct dcache));
memset((char *)tdp, 0, aDentries * sizeof(struct dcache));
#ifdef AFS_AIX32_ENV
pin((char *)afs_indexTable, sizeof(struct dcache *) * afiles);/* XXX */
pin((char *)afs_indexTimes, sizeof(afs_hyper_t) * afiles); /* XXX */

View File

@ -37,7 +37,7 @@ char *data;
}
length = (size ? size : sizeof(struct afs_exporter));
ex = (struct afs_exporter *) afs_osi_Alloc(length);
bzero((char *)ex, length);
memset((char *)ex, 0, length);
MObtainWriteLock(&afs_xexp,308);
for (op = root_exported; op; op = op->exp_next) {
if (!op->exp_next)

View File

@ -695,8 +695,8 @@ shutdown_cache()
cacheInfoModTime = 0;
afs_fsfragsize = 1023;
bzero((char *)&afs_stats_cmperf, sizeof(afs_stats_cmperf));
bzero((char *)&cacheDev, sizeof(struct osi_dev));
memset((char *)&afs_stats_cmperf, 0, sizeof(afs_stats_cmperf));
memset((char *)&cacheDev, 0, sizeof(struct osi_dev));
osi_dnlc_shutdown();
}
} /*shutdown_cache*/
@ -860,7 +860,7 @@ void shutdown_AFS()
afs_FVIndex = -1;
afs_server = (struct rx_service *)0;
RWLOCK_INIT(&afs_xconn, "afs_xconn");
bzero((char *)&afs_rootFid, sizeof(struct VenusFid));
memset((char *)&afs_rootFid, 0, sizeof(struct VenusFid));
RWLOCK_INIT(&afs_xuser, "afs_xuser");
RWLOCK_INIT(&afs_xvolume, "afs_xvolume"), RWLOCK_INIT(&afs_xcell, "afs_xcell");
RWLOCK_INIT(&afs_xserver, "afs_xserver"), LOCK_INIT(&afs_puttofileLock, "afs_puttofileLock");

View File

@ -73,7 +73,7 @@ afs_InitMemCache(size, blkSize, flags)
if (blk == NULL)
goto nomem;
(memCache+index)->data = blk;
bzero((memCache+index)->data, memCacheBlkSize);
memset((memCache+index)->data, 0, memCacheBlkSize);
}
#if defined(AFS_SGI62_ENV) || defined(AFS_HAVE_VXFS)
afs_InitDualFSCacheOps((struct vnode*)0);
@ -132,7 +132,7 @@ afs_MemReadBlk(mceP, offset, dest, size)
if(bytesRead > 0) {
AFS_GUNLOCK();
bcopy(mceP->data + offset, dest, bytesRead);
memcpy(dest, mceP->data + offset, bytesRead);
AFS_GLOCK();
}
else
@ -170,7 +170,7 @@ afs_MemReadvBlk(mceP, offset, iov, nio, size)
for (i = 0 , size = bytesRead ; i < nio && size > 0 ; i++) {
bytesToRead = (size < iov[i].iov_len) ? size : iov[i].iov_len;
AFS_GUNLOCK();
bcopy(mceP->data + offset, iov[i].iov_base, bytesToRead);
memcpy(iov[i].iov_base, mceP->data + offset, bytesToRead);
AFS_GLOCK();
offset += bytesToRead;
size -= bytesToRead;
@ -227,15 +227,15 @@ afs_MemWriteBlk(mceP, offset, src, size)
/* may overlap, but this is OK */
AFS_GUNLOCK();
bcopy(oldData, mceP->data, mceP->size);
memcpy(mceP->data, oldData, mceP->size);
AFS_GLOCK();
afs_osi_Free(oldData,mceP->dataSize);
mceP->dataSize = size+offset;
}
AFS_GUNLOCK();
if (mceP->size < offset)
bzero(mceP->data+mceP->size, offset-mceP->size);
bcopy(src, mceP->data + offset, size);
memset(mceP->data+mceP->size, 0, offset-mceP->size);
memcpy(mceP->data + offset, src, size);
AFS_GLOCK();
mceP->size = (size+offset < mceP->size) ? mceP->size :
size + offset;
@ -264,17 +264,17 @@ afs_MemWritevBlk(mceP, offset, iov, nio, size)
/* may overlap, but this is OK */
AFS_GUNLOCK();
bcopy(oldData, mceP->data, mceP->size);
memcpy(mceP->data, oldData, mceP->size);
AFS_GLOCK();
afs_osi_Free(oldData,mceP->dataSize);
mceP->dataSize = size+offset;
}
if (mceP->size < offset)
bzero(mceP->data+mceP->size, offset-mceP->size);
memset(mceP->data+mceP->size, 0, offset-mceP->size);
for (bytesWritten = 0, i = 0 ; i < nio && size > 0 ; i++) {
bytesToWrite = (size < iov[i].iov_len) ? size : iov[i].iov_len;
AFS_GUNLOCK();
bcopy(iov[i].iov_base, mceP->data + offset, bytesToWrite);
memcpy(mceP->data + offset, iov[i].iov_base, bytesToWrite);
AFS_GLOCK();
offset += bytesToWrite;
bytesWritten += bytesToWrite;
@ -301,14 +301,14 @@ afs_MemWriteUIO(blkno, uioP)
mceP->data = afs_osi_Alloc(uioP->uio_resid + uioP->uio_offset);
AFS_GUNLOCK();
bcopy(oldData, mceP->data, mceP->size);
memcpy(mceP->data, oldData, mceP->size);
AFS_GLOCK();
afs_osi_Free(oldData,mceP->dataSize);
mceP->dataSize = uioP->uio_resid + uioP->uio_offset;
}
if (mceP->size < uioP->uio_offset)
bzero(mceP->data+mceP->size, (int)(uioP->uio_offset-mceP->size));
memset(mceP->data+mceP->size, 0, (int)(uioP->uio_offset-mceP->size));
AFS_UIOMOVE(mceP->data+uioP->uio_offset, uioP->uio_resid, UIO_WRITE, uioP, code);
if (uioP->uio_offset > mceP->size)
mceP->size = uioP->uio_offset;

View File

@ -72,9 +72,9 @@ register afs_int32 uid, host;
}
}
np = (struct nfsclientpag *) afs_osi_Alloc(sizeof (struct nfsclientpag));
bzero((char *)np, sizeof(struct nfsclientpag));
memset((char *)np, 0, sizeof(struct nfsclientpag));
/* Copy the necessary afs_exporter fields */
bcopy((char *)afs_nfsexporter, (char *)np, sizeof(struct afs_exporter));
memcpy((char *)np, (char *)afs_nfsexporter, sizeof(struct afs_exporter));
np->next = afs_nfspags[i];
afs_nfspags[i] = np;
np->uid = uid;

View File

@ -72,7 +72,7 @@ void osi_Init()
if ( !afs_osicred_initialized )
{
bzero((char *)&afs_osi_cred, sizeof(struct AFS_UCRED));
memset((char *)&afs_osi_cred, 0, sizeof(struct AFS_UCRED));
crhold(&afs_osi_cred); /* don't let it evaporate */
afs_osicred_initialized = 1;
}
@ -935,7 +935,7 @@ const struct AFS_UCRED *afs_osi_proc2cred(AFS_PROC *pr)
cr.cr_ref=1;
cr.cr_uid=pr->p_cred->pc_ucred->cr_uid;
cr.cr_ngroups=pr->p_cred->pc_ucred->cr_ngroups;
bcopy(pr->p_cred->pc_ucred->cr_groups, cr.cr_groups,NGROUPS *
memcpy(cr.cr_groups, pr->p_cred->pc_ucred->cr_groups, NGROUPS *
sizeof(gid_t));
pcred_unlock(pr);
rv = &cr;

View File

@ -33,11 +33,11 @@ register struct iovec *aoutvec; {
AFS_STATCNT(afsio_copy);
if (ainuio->afsio_iovcnt > AFS_MAXIOVCNT) return EINVAL;
bcopy((char *)ainuio, (char *)aoutuio, sizeof(struct uio));
memcpy((char *)aoutuio, (char *)ainuio, sizeof(struct uio));
tvec = ainuio->afsio_iov;
aoutuio->afsio_iov = aoutvec;
for(i=0;i<ainuio->afsio_iovcnt;i++){
bcopy((char *)tvec, (char *)aoutvec, sizeof(struct iovec));
memcpy((char *)aoutvec, (char *)tvec, sizeof(struct iovec));
tvec++; /* too many compiler bugs to do this as one expr */
aoutvec++;
}

View File

@ -37,7 +37,7 @@ int afs_osi_vget(struct vcache **avcpp, struct fid *afidp,
register afs_int32 code = 0, cellindex;
afs_int32 ret;
bcopy(afidp->fid_data, (char *)&Sfid, SIZEOF_SMALLFID);
memcpy((char *)&Sfid, afidp->fid_data, SIZEOF_SMALLFID);
#ifdef AFS_OSF_ENV
Sfid.Vnode = afidp->fid_reserved;
#endif

View File

@ -174,7 +174,7 @@ retry:
tnc->dirp = adp;
tnc->vp = avc;
tnc->key = key;
bcopy (aname, (char *)tnc->name, ts-aname+1); /* include the NULL */
memcpy((char *)tnc->name, aname, ts-aname+1); /* include the NULL */
InsertEntry(tnc);
} else {
@ -446,8 +446,8 @@ int osi_dnlc_purge()
}
else { /* did get the lock */
ncfreelist = (struct nc *) 0;
bzero ((char *)nameCache, sizeof(struct nc) * NCSIZE);
bzero ((char *)nameHash, sizeof(struct nc *) * NHSIZE);
memset((char *)nameCache, 0, sizeof(struct nc) * NCSIZE);
memset((char *)nameHash, 0, sizeof(struct nc *) * NHSIZE);
for (i=0; i<NCSIZE; i++) {
nameCache[i].next = ncfreelist;
ncfreelist = &nameCache[i];
@ -475,13 +475,13 @@ int osi_dnlc_init()
int i;
Lock_Init(&afs_xdnlc);
bzero ((char *)&dnlcstats, sizeof(dnlcstats));
bzero ((char *)dnlctracetable, sizeof(dnlctracetable));
memset((char *)&dnlcstats, 0, sizeof(dnlcstats));
memset((char *)dnlctracetable, 0, sizeof(dnlctracetable));
dnlct=0;
ObtainWriteLock(&afs_xdnlc,223);
ncfreelist = (struct nc *) 0;
bzero ((char *)nameCache, sizeof(struct nc) * NCSIZE);
bzero ((char *)nameHash, sizeof(struct nc *) * NHSIZE);
memset((char *)nameCache, 0, sizeof(struct nc) * NCSIZE);
memset((char *)nameHash, 0, sizeof(struct nc *) * NHSIZE);
for (i=0; i<NCSIZE; i++) {
nameCache[i].next = ncfreelist;
ncfreelist = &nameCache[i];

View File

@ -1087,7 +1087,7 @@ static PGetFID(avc, afun, areq, ain, aout, ainSize, aoutSize)
AFS_STATCNT(PGetFID);
if (!avc) return EINVAL;
bcopy((char *)&avc->fid, aout, sizeof(struct VenusFid));
memcpy(aout, (char *)&avc->fid, sizeof(struct VenusFid));
*aoutSize = sizeof(struct VenusFid);
return 0;
}
@ -1387,23 +1387,23 @@ static PGCPAGs(avc, afun, areq, ain, aout, ainSize, aoutSize, acred)
if (!afs_resourceinit_flag) {
return EIO;
}
bcopy(ain, (char *)&i, sizeof(afs_int32));
memcpy((char *)&i, ain, sizeof(afs_int32));
ain += sizeof(afs_int32);
stp = ain; /* remember where the ticket is */
if (i < 0 || i > 2000) return EINVAL; /* malloc may fail */
stLen = i;
ain += i; /* skip over ticket */
bcopy(ain, (char *)&i, sizeof(afs_int32));
memcpy((char *)&i, ain, sizeof(afs_int32));
ain += sizeof(afs_int32);
if (i != sizeof(struct ClearToken)) {
return EINVAL;
}
bcopy(ain, (char *)&clear, sizeof(struct ClearToken));
memcpy((char *)&clear, ain, sizeof(struct ClearToken));
if (clear.AuthHandle == -1) clear.AuthHandle = 999; /* more rxvab compat stuff */
ain += sizeof(struct ClearToken);
if (ainSize != 2*sizeof(afs_int32) + stLen + sizeof(struct ClearToken)) {
/* still stuff left? we've got primary flag and cell name. Set these */
bcopy(ain, (char *)&flag, sizeof(afs_int32)); /* primary id flag */
memcpy((char *)&flag, ain, sizeof(afs_int32)); /* primary id flag */
ain += sizeof(afs_int32); /* skip id field */
/* rest is cell name, look it up */
if (flag & 0x8000) { /* XXX Use Constant XXX */
@ -1452,7 +1452,7 @@ static PGCPAGs(avc, afun, areq, ain, aout, ainSize, aoutSize, acred)
}
tu->stp = (char *) afs_osi_Alloc(stLen);
tu->stLen = stLen;
bcopy(stp, tu->stp, stLen);
memcpy(tu->stp, stp, stLen);
tu->ct = clear;
#ifndef AFS_NOSTATS
afs_stats_cmfullperf.authent.TicketUpdates++;
@ -1523,7 +1523,7 @@ static PGetVolumeStatus(avc, afun, areq, ain, aout, ainSize, aoutSize)
if (code) return code;
/* Copy all this junk into msg->im_data, keeping track of the lengths. */
cp = aout;
bcopy((char *)&volstat, cp, sizeof(VolumeStatus));
memcpy(cp, (char *)&volstat, sizeof(VolumeStatus));
cp += sizeof(VolumeStatus);
strcpy(cp, volName);
cp += strlen(volName)+1;
@ -1567,7 +1567,7 @@ static PSetVolumeStatus(avc, afun, areq, ain, aout, ainSize, aoutSize)
return ENODEV;
/* Copy the junk out, using cp as a roving pointer. */
cp = ain;
bcopy(cp, (char *)&volstat, sizeof(AFSFetchVolumeStatus));
memcpy((char *)&volstat, cp, sizeof(AFSFetchVolumeStatus));
cp += sizeof(AFSFetchVolumeStatus);
if (strlen(cp) >= sizeof(volName))
return E2BIG;
@ -1613,7 +1613,7 @@ static PSetVolumeStatus(avc, afun, areq, ain, aout, ainSize, aoutSize)
/* we are sending parms back to make compat. with prev system. should
change interface later to not ask for current status, just set new status */
cp = aout;
bcopy((char *)&volstat, cp, sizeof(VolumeStatus));
memcpy(cp, (char *)&volstat, sizeof(VolumeStatus));
cp += sizeof(VolumeStatus);
strcpy(cp, volName);
cp += strlen(volName)+1;
@ -1760,7 +1760,7 @@ static PGetTokens(avc, afun, areq, ain, aout, ainSize, aoutSize)
at the end, in that order.
*/
if (newStyle = (ainSize > 0)) {
bcopy(ain, (char *)&iterator, sizeof(afs_int32));
memcpy((char *)&iterator, ain, sizeof(afs_int32));
}
i = UHash(areq->uid);
ObtainReadLock(&afs_xuser);
@ -1794,19 +1794,19 @@ static PGetTokens(avc, afun, areq, ain, aout, ainSize, aoutSize)
cp = aout;
iterator = tu->stLen; /* for compat, we try to return 56 byte tix if they fit */
if (iterator < 56) iterator = 56; /* # of bytes we're returning */
bcopy((char *)&iterator, cp, sizeof(afs_int32));
memcpy(cp, (char *)&iterator, sizeof(afs_int32));
cp += sizeof(afs_int32);
bcopy(tu->stp, cp, tu->stLen); /* copy out st */
memcpy(cp, tu->stp, tu->stLen); /* copy out st */
cp += iterator;
iterator = sizeof(struct ClearToken);
bcopy((char *)&iterator, cp, sizeof(afs_int32));
memcpy(cp, (char *)&iterator, sizeof(afs_int32));
cp += sizeof(afs_int32);
bcopy((char *)&tu->ct, cp, sizeof(struct ClearToken));
memcpy(cp, (char *)&tu->ct, sizeof(struct ClearToken));
cp += sizeof(struct ClearToken);
if (newStyle) {
/* put out primary id and cell name, too */
iterator = (tu->states & UPrimary ? 1 : 0);
bcopy((char *)&iterator, cp, sizeof(afs_int32));
memcpy(cp, (char *)&iterator, sizeof(afs_int32));
cp += sizeof(afs_int32);
tcell = afs_GetCell(tu->cell, READ_LOCK);
if (tcell) {
@ -1842,7 +1842,7 @@ static PUnlog(avc, afun, areq, ain, aout, ainSize, aoutSize)
tu->vid = UNDEFVID;
tu->states &= ~UHasTokens;
/* security is not having to say you're sorry */
bzero((char *)&tu->ct, sizeof(struct ClearToken));
memset((char *)&tu->ct, 0, sizeof(struct ClearToken));
tu->refCount++;
ReleaseWriteLock(&afs_xuser);
/* We have to drop the lock over the call to afs_ResetUserConns, since
@ -1881,11 +1881,11 @@ static PMariner(avc, afun, areq, ain, aout, ainSize, aoutSize)
AFS_STATCNT(PMariner);
if (afs_mariner)
bcopy((char *)&afs_marinerHost, (char *)&oldHostAddr, sizeof(afs_int32));
memcpy((char *)&oldHostAddr, (char *)&afs_marinerHost, sizeof(afs_int32));
else
oldHostAddr = 0xffffffff; /* disabled */
bcopy(ain, (char *)&newHostAddr, sizeof(afs_int32));
memcpy((char *)&newHostAddr, ain, sizeof(afs_int32));
if (newHostAddr == 0xffffffff) {
/* disable mariner operations */
afs_mariner = 0;
@ -1894,7 +1894,7 @@ static PMariner(avc, afun, areq, ain, aout, ainSize, aoutSize)
afs_mariner = 1;
afs_marinerHost = newHostAddr;
}
bcopy((char *)&oldHostAddr, aout, sizeof(afs_int32));
memcpy(aout, (char *)&oldHostAddr, sizeof(afs_int32));
*aoutSize = sizeof(afs_int32);
return 0;
}
@ -1924,7 +1924,7 @@ static PCheckServers(avc, afun, areq, ain, aout, ainSize, aoutSize, acred)
pcheck=(struct chservinfo *)ain;
if (pcheck->tinterval >= 0) {
cp = aout;
bcopy((char *)&PROBE_INTERVAL, cp, sizeof(afs_int32));
memcpy(cp, (char *)&PROBE_INTERVAL, sizeof(afs_int32));
*aoutSize = sizeof(afs_int32);
if (pcheck->tinterval > 0) {
if (!afs_osi_suser(acred))
@ -1938,7 +1938,7 @@ static PCheckServers(avc, afun, areq, ain, aout, ainSize, aoutSize, acred)
temp=pcheck->tflags;
cp = pcheck->tbuffer;
} else { /* For pre afs3.3 versions */
bcopy(ain, (char *)&temp, sizeof(afs_int32));
memcpy((char *)&temp, ain, sizeof(afs_int32));
cp = ain+sizeof(afs_int32);
if (ainSize > sizeof(afs_int32))
havecell = 1;
@ -1969,7 +1969,7 @@ static PCheckServers(avc, afun, areq, ain, aout, ainSize, aoutSize, acred)
for(ts = afs_servers[i]; ts; ts=ts->next) {
if (cellp && ts->cell != cellp) continue; /* cell spec'd and wrong */
if ((ts->flags & SRVR_ISDOWN) && ts->addr->sa_portal != ts->cell->vlport) {
bcopy((char *)&ts->addr->sa_ip, cp, sizeof(afs_int32));
memcpy(cp, (char *)&ts->addr->sa_ip, sizeof(afs_int32));
cp += sizeof(afs_int32);
}
}
@ -2040,7 +2040,7 @@ static PCheckAuth(avc, afun, areq, ain, aout, ainSize, aoutSize)
ReleaseReadLock(&afs_xconn);
afs_PutUser(tu, READ_LOCK);
}
bcopy((char *)&retValue, aout, sizeof(afs_int32));
memcpy(aout, (char *)&retValue, sizeof(afs_int32));
*aoutSize = sizeof(afs_int32);
return 0;
}
@ -2095,13 +2095,13 @@ static PFindVolume(avc, afun, areq, ain, aout, ainSize, aoutSize)
for(i=0;i<MAXHOSTS;i++) {
ts = tvp->serverHost[i];
if (!ts) break;
bcopy((char *)&ts->addr->sa_ip, cp, sizeof(afs_int32));
memcpy(cp, (char *)&ts->addr->sa_ip, sizeof(afs_int32));
cp += sizeof(afs_int32);
}
if (i<MAXHOSTS) {
/* still room for terminating NULL, add it on */
ainSize = 0; /* reuse vbl */
bcopy((char *)&ainSize, cp, sizeof(afs_int32));
memcpy(cp, (char *)&ainSize, sizeof(afs_int32));
cp += sizeof(afs_int32);
}
*aoutSize = cp - aout;
@ -2125,7 +2125,7 @@ static PViceAccess(avc, afun, areq, ain, aout, ainSize, aoutSize)
if (!avc) return EINVAL;
code = afs_VerifyVCache(avc, areq);
if (code) return code;
bcopy(ain, (char *)&temp, sizeof(afs_int32));
memcpy((char *)&temp, ain, sizeof(afs_int32));
code = afs_AccessOK(avc,temp, areq, CHECK_MODE_BITS);
if (code) return 0;
else return EACCES;
@ -2148,7 +2148,7 @@ static PSetCacheSize(avc, afun, areq, ain, aout, ainSize, aoutSize, acred)
return EACCES;
/* too many things are setup initially in mem cache version */
if (cacheDiskType == AFS_FCACHE_TYPE_MEM) return EROFS;
bcopy(ain, (char *)&newValue, sizeof(afs_int32));
memcpy((char *)&newValue, ain, sizeof(afs_int32));
if (newValue == 0) afs_cacheBlocks = afs_stats_cmperf.cacheBlocksOrig;
else {
extern u_int afs_min_cache;
@ -2178,10 +2178,10 @@ afs_int32 *aoutSize; /* set this */ {
afs_int32 results[MAXGCSTATS];
AFS_STATCNT(PGetCacheSize);
bzero((char *)results, sizeof(results));
memset((char *)results, 0, sizeof(results));
results[0] = afs_cacheBlocks;
results[1] = afs_blocksUsed;
bcopy((char *)results, aout, sizeof(results));
memcpy(aout, (char *)results, sizeof(results));
*aoutSize = sizeof(results);
return 0;
}
@ -2265,7 +2265,7 @@ static PNewCell(avc, afun, areq, ain, aout, ainSize, aoutSize, acred)
if (!afs_osi_suser(acred))
return EACCES;
bcopy(tp, (char *)&magic, sizeof(afs_int32));
memcpy((char *)&magic, tp, sizeof(afs_int32));
tp += sizeof(afs_int32);
if (magic != 0x12345678)
return EINVAL;
@ -2279,7 +2279,7 @@ static PNewCell(avc, afun, areq, ain, aout, ainSize, aoutSize, acred)
scount = ((newcell[0] != '\0') ? MAXCELLHOSTS : MAXHOSTS);
/* MAXCELLHOSTS (=8) is less than MAXHOSTS (=13) */
bcopy(tp, (char *)cellHosts, MAXCELLHOSTS * sizeof(afs_int32));
memcpy((char *)cellHosts, tp, MAXCELLHOSTS * sizeof(afs_int32));
tp += (scount * sizeof(afs_int32));
lp = (afs_int32 *)tp;
@ -2316,7 +2316,7 @@ static PListCells(avc, afun, areq, ain, aout, ainSize, aoutSize)
if ( !afs_resourceinit_flag ) /* afs deamons havn't started yet */
return EIO; /* Inappropriate ioctl for device */
bcopy(tp, (char *)&whichCell, sizeof(afs_int32));
memcpy((char *)&whichCell, tp, sizeof(afs_int32));
tp += sizeof(afs_int32);
ObtainReadLock(&afs_xcell);
for (cq = CellLRU.next; cq != &CellLRU; cq = tq) {
@ -2327,10 +2327,10 @@ static PListCells(avc, afun, areq, ain, aout, ainSize, aoutSize)
}
if (tcell) {
cp = aout;
bzero(cp, MAXCELLHOSTS * sizeof(afs_int32));
memset(cp, 0, MAXCELLHOSTS * sizeof(afs_int32));
for(i=0;i<MAXCELLHOSTS;i++) {
if (tcell->cellHosts[i] == 0) break;
bcopy((char *)&tcell->cellHosts[i]->addr->sa_ip, cp, sizeof(afs_int32));
memcpy(cp, (char *)&tcell->cellHosts[i]->addr->sa_ip, sizeof(afs_int32));
cp += sizeof(afs_int32);
}
cp = aout + MAXCELLHOSTS * sizeof(afs_int32);
@ -2495,7 +2495,7 @@ static PGetCellStatus(avc, afun, areq, ain, aout, ainSize, aoutSize)
if (!tcell) return ENOENT;
temp = tcell->states;
afs_PutCell(tcell, READ_LOCK);
bcopy((char *)&temp, aout, sizeof(afs_int32));
memcpy(aout, (char *)&temp, sizeof(afs_int32));
*aoutSize = sizeof(afs_int32);
return 0;
}
@ -2518,7 +2518,7 @@ static PSetCellStatus(avc, afun, areq, ain, aout, ainSize, aoutSize, acred)
tcell = afs_GetCellByName(ain+2*sizeof(afs_int32), WRITE_LOCK);
if (!tcell) return ENOENT;
bcopy(ain, (char *)&temp, sizeof(afs_int32));
memcpy((char *)&temp, ain, sizeof(afs_int32));
if (temp & CNoSUID)
tcell->states |= CNoSUID;
else
@ -2681,7 +2681,7 @@ static PGetVnodeXStatus(avc, afun, areq, ain, aout, ainSize, aoutSize)
stat.flockCount = avc->flockCount;
stat.mvstat = avc->mvstat;
stat.states = avc->states;
bcopy((char *)&stat, aout, sizeof(struct vcxstat));
memcpy(aout, (char *)&stat, sizeof(struct vcxstat));
*aoutSize = sizeof(struct vcxstat);
return 0;
}
@ -2721,8 +2721,8 @@ register struct AFS_UCRED *acred;
return (setuerror(EINVAL), EINVAL);
#endif
}
bzero(inname, MAXSYSNAME);
bcopy(ain, (char *)&setsysname, sizeof(afs_int32));
memset(inname, 0, MAXSYSNAME);
memcpy((char *)&setsysname, ain, sizeof(afs_int32));
ain += sizeof(afs_int32);
if (setsysname) {
@ -2743,7 +2743,7 @@ register struct AFS_UCRED *acred;
/* inname gets first entry in case we're being a translater */
t = strlen(ain);
bcopy(ain, inname, t+1); /* include terminating null */
memcpy(inname, ain, t+1); /* include terminating null */
ain += t + 1;
}
if (acred->cr_gid == RMTUSER_REQ) { /* Handles all exporters */
@ -2789,7 +2789,7 @@ register struct AFS_UCRED *acred;
if (!afs_sysnamelist[count])
osi_Panic("PSetSysName: no afs_sysnamelist entry to write\n");
t = strlen(cp);
bcopy(cp, afs_sysnamelist[count], t+1); /* include null */
memcpy(afs_sysnamelist[count], cp, t+1); /* include null */
cp += t+1;
}
}
@ -2798,7 +2798,7 @@ register struct AFS_UCRED *acred;
}
if (!setsysname) {
cp = aout; /* not changing so report back the count and ... */
bcopy((char *)&foundname, cp, sizeof(afs_int32));
memcpy(cp, (char *)&foundname, sizeof(afs_int32));
cp += sizeof(afs_int32);
if (foundname) {
strcpy(cp, outname); /* ... the entry, ... */
@ -3094,7 +3094,7 @@ struct AFS_UCRED *acred;
register struct afs_exporter *exporter;
AFS_STATCNT(PExportAfs);
bcopy(ain, (char *)&handleValue, sizeof(afs_int32));
memcpy((char *)&handleValue, ain, sizeof(afs_int32));
type = handleValue >> 24;
if (type == 0x71) {
newint = 1;
@ -3120,7 +3120,7 @@ struct AFS_UCRED *acred;
}
if (!changestate) {
handleValue = exporter->exp_states;
bcopy((char *)&handleValue, aout, sizeof(afs_int32));
memcpy(aout, (char *)&handleValue, sizeof(afs_int32));
*aoutSize = sizeof(afs_int32);
} else {
if (!afs_osi_suser(acred))
@ -3154,7 +3154,7 @@ struct AFS_UCRED *acred;
}
}
handleValue = exporter->exp_states;
bcopy((char *)&handleValue, aout, sizeof(afs_int32));
memcpy(aout, (char *)&handleValue, sizeof(afs_int32));
*aoutSize = sizeof(afs_int32);
} else {
if (export)
@ -3258,7 +3258,7 @@ static int PGetInitParams(avc, afun, areq, ain, aout, ainSize, aoutSize)
if (sizeof(struct cm_initparams) > PIGGYSIZE)
return E2BIG;
bcopy((char*)&cm_initParams, aout, sizeof(struct cm_initparams));
memcpy(aout, (char*)&cm_initParams, sizeof(struct cm_initparams));
*aoutSize = sizeof(struct cm_initparams);
return 0;
}
@ -3269,7 +3269,7 @@ static cred_t *crget(void)
{
cred_t *cr;
cr = crdup(get_current_cred());
bzero((char*)cr, sizeof(cred_t));
memset((char*)cr, 0, sizeof(cred_t));
#if CELL || CELL_PREPARE
cr->cr_id = -1;
#endif
@ -3287,7 +3287,7 @@ afs_int32 ainSize;
afs_int32 *aoutSize;
struct AFS_UCRED *acred;
{
bcopy((char *)&cryptall, aout, sizeof(afs_int32));
memcpy(aout, (char *)&cryptall, sizeof(afs_int32));
*aoutSize=sizeof(afs_int32);
return 0;
}
@ -3308,7 +3308,7 @@ struct AFS_UCRED *acred;
return EPERM;
if (ainSize != sizeof(afs_int32) || ain == NULL)
return EINVAL;
bcopy(ain, (char *)&tmpval, sizeof(afs_int32));
memcpy((char *)&tmpval, ain, sizeof(afs_int32));
/* if new mappings added later this will need to be changed */
if (tmpval != 0 && tmpval != 1)
return EINVAL;
@ -3642,7 +3642,7 @@ static PRxStatProc(avc, afun, areq, ain, aout, ainSize, aoutSize, acred)
code = EINVAL;
goto out;
}
bcopy(ain, (char *)&flags, sizeof(afs_int32));
memcpy((char *)&flags, ain, sizeof(afs_int32));
if (!(flags & AFSCALL_RXSTATS_MASK) || (flags & ~AFSCALL_RXSTATS_MASK)) {
code = EINVAL;
goto out;
@ -3682,7 +3682,7 @@ static PRxStatPeer(avc, afun, areq, ain, aout, ainSize, aoutSize, acred)
code = EINVAL;
goto out;
}
bcopy(ain, (char *)&flags, sizeof(afs_int32));
memcpy((char *)&flags, ain, sizeof(afs_int32));
if (!(flags & AFSCALL_RXSTATS_MASK) || (flags & ~AFSCALL_RXSTATS_MASK)) {
code = EINVAL;
goto out;

View File

@ -237,7 +237,7 @@ afs_StoreAllSegments(avc, areq, sync)
minj = 0 ;
do {
bzero ((char *)dcList, NCHUNKSATONCE * sizeof(struct dcache *));
memset((char *)dcList, 0, NCHUNKSATONCE * sizeof(struct dcache *));
high = 0;
moredata = FALSE;
@ -448,7 +448,7 @@ afs_StoreAllSegments(avc, areq, sync)
while (sbytes > 0) {
tlen = (sbytes > AFS_LRALLOCSIZ ? AFS_LRALLOCSIZ : sbytes);
bzero(tbuffer, tlen);
memset(tbuffer, 0, tlen);
#ifdef RX_ENABLE_LOCKS
AFS_GUNLOCK();
#endif /* RX_ENABLE_LOCKS */

View File

@ -380,26 +380,22 @@ void afs_CountServers()
afs_stats_cmperf.fs_UpDown[0].sumOfRecordAges = 0;
afs_stats_cmperf.fs_UpDown[0].ageOfYoungestRecord = 0;
afs_stats_cmperf.fs_UpDown[0].ageOfOldestRecord = 0;
bzero((char *) afs_stats_cmperf.fs_UpDown[0].downIncidents,
AFS_STATS_NUM_DOWNTIME_INCIDENTS_BUCKETS * sizeof(afs_int32));
memset((char *) afs_stats_cmperf.fs_UpDown[0].downIncidents, 0, AFS_STATS_NUM_DOWNTIME_INCIDENTS_BUCKETS * sizeof(afs_int32));
afs_stats_cmperf.fs_UpDown[1].sumOfRecordAges = 0;
afs_stats_cmperf.fs_UpDown[1].ageOfYoungestRecord = 0;
afs_stats_cmperf.fs_UpDown[1].ageOfOldestRecord = 0;
bzero((char *) afs_stats_cmperf.fs_UpDown[1].downIncidents,
AFS_STATS_NUM_DOWNTIME_INCIDENTS_BUCKETS * sizeof(afs_int32));
memset((char *) afs_stats_cmperf.fs_UpDown[1].downIncidents, 0, AFS_STATS_NUM_DOWNTIME_INCIDENTS_BUCKETS * sizeof(afs_int32));
afs_stats_cmperf.vl_UpDown[0].sumOfRecordAges = 0;
afs_stats_cmperf.vl_UpDown[0].ageOfYoungestRecord = 0;
afs_stats_cmperf.vl_UpDown[0].ageOfOldestRecord = 0;
bzero((char *) afs_stats_cmperf.vl_UpDown[0].downIncidents,
AFS_STATS_NUM_DOWNTIME_INCIDENTS_BUCKETS * sizeof(afs_int32));
memset((char *) afs_stats_cmperf.vl_UpDown[0].downIncidents, 0, AFS_STATS_NUM_DOWNTIME_INCIDENTS_BUCKETS * sizeof(afs_int32));
afs_stats_cmperf.vl_UpDown[1].sumOfRecordAges = 0;
afs_stats_cmperf.vl_UpDown[1].ageOfYoungestRecord = 0;
afs_stats_cmperf.vl_UpDown[1].ageOfOldestRecord = 0;
bzero((char *) afs_stats_cmperf.vl_UpDown[1].downIncidents,
AFS_STATS_NUM_DOWNTIME_INCIDENTS_BUCKETS * sizeof(afs_int32));
memset((char *) afs_stats_cmperf.vl_UpDown[1].downIncidents, 0, AFS_STATS_NUM_DOWNTIME_INCIDENTS_BUCKETS * sizeof(afs_int32));
/*
* Compute the current time, used to figure out server record ages.
@ -661,7 +657,7 @@ struct server *afs_FindServer (afs_int32 aserver, ushort aport,
i = afs_uuid_hash(uuidp) % NSERVERS;
for (ts = afs_servers[i]; ts; ts = ts->next) {
if ( (ts->flags & SRVR_MULTIHOMED) &&
(bcmp((char *)uuidp, (char *)&ts->sr_uuid, sizeof(*uuidp)) == 0) &&
(memcmp((char *)uuidp, (char *)&ts->sr_uuid, sizeof(*uuidp)) == 0) &&
(!ts->addr || (ts->addr->sa_portal == aport)) )
return ts;
}
@ -1382,7 +1378,7 @@ struct server *afs_GetServer(afs_uint32 *aserverp, afs_int32 nservers,
newts = (struct server *) afs_osi_Alloc(sizeof(struct server));
if (!newts) panic("malloc of server struct");
afs_totalServers++;
bzero((char *)newts, sizeof(struct server));
memset((char *)newts, 0, sizeof(struct server));
/* Add the server struct to the afs_servers[] hash chain */
srvhash = (uuidp ? (afs_uuid_hash(uuidp)%NSERVERS) : SHash(aserverp[0]));
@ -1423,7 +1419,7 @@ struct server *afs_GetServer(afs_uint32 *aserverp, afs_int32 nservers,
newsa = (struct srvAddr *) afs_osi_Alloc(sizeof(struct srvAddr));
if (!newsa) panic("malloc of srvAddr struct");
afs_totalSrvAddrs++;
bzero((char *)newsa, sizeof(struct srvAddr));
memset((char *)newsa, 0, sizeof(struct srvAddr));
/* Add the new srvAddr to the afs_srvAddrs[] hash chain */
newsa->next_bkt = afs_srvAddrs[iphash];
@ -1471,7 +1467,7 @@ struct server *afs_GetServer(afs_uint32 *aserverp, afs_int32 nservers,
if (!orphts) {
orphts = (struct server *) afs_osi_Alloc(sizeof(struct server));
if (!orphts) panic("malloc of lo server struct");
bzero((char *)orphts, sizeof(struct server));
memset((char *)orphts, 0, sizeof(struct server));
afs_totalServers++;
/* Add the orphaned server to the afs_servers[] hash chain.

View File

@ -48,10 +48,9 @@ void afs_InitStats()
/*
* First step is to zero everything out.
*/
bzero((char *)(&afs_cmstats), sizeof(struct afs_CMStats));
bzero((char *)(&afs_stats_cmperf), sizeof(struct afs_stats_CMPerf));
bzero((char *)(&afs_stats_cmfullperf),
sizeof(struct afs_stats_CMFullPerf));
memset((char *)(&afs_cmstats), 0, sizeof(struct afs_CMStats));
memset((char *)(&afs_stats_cmperf), 0, sizeof(struct afs_stats_CMPerf));
memset((char *)(&afs_stats_cmfullperf), 0, sizeof(struct afs_stats_CMFullPerf));
/*
* Some fields really should be non-zero at the start, so set 'em up.

View File

@ -479,7 +479,7 @@ struct unixuser *afs_GetUser(auid, acell, locktype)
#ifndef AFS_NOSTATS
afs_stats_cmfullperf.authent.PAGCreations++;
#endif /* AFS_NOSTATS */
bzero((char *)tu, sizeof(struct unixuser));
memset((char *)tu, 0, sizeof(struct unixuser));
tu->next = afs_users[i];
afs_users[i] = tu;
if (RmtUser) {

View File

@ -752,7 +752,7 @@ struct vcache *afs_NewVCache(struct VenusFid *afid, struct server *serverp,
#endif /* AFS_MACH_ENV */
#if defined(AFS_SGI_ENV)
{ char name[METER_NAMSZ];
bzero(tvc, sizeof(struct vcache));
memset(tvc, 0, sizeof(struct vcache));
tvc->v.v_number = ++afsvnumbers;
tvc->vc_rwlockid = OSI_NO_LOCKID;
initnsema(&tvc->vc_rwlock, 1, makesname(name, "vrw", tvc->v.v_number));
@ -777,7 +777,7 @@ struct vcache *afs_NewVCache(struct VenusFid *afid, struct server *serverp,
#endif /* AFS_MACH_ENV */
#if !defined(AFS_SGI_ENV) && !defined(AFS_OSF_ENV)
bzero((char *)tvc, sizeof(struct vcache));
memset((char *)tvc, 0, sizeof(struct vcache));
#else
tvc->uncred = 0;
#endif
@ -851,10 +851,10 @@ struct vcache *afs_NewVCache(struct VenusFid *afid, struct server *serverp,
#ifdef AFS_AIX_ENV
/* Don't forget to free the gnode space */
tvc->v.v_gnode = gnodepnt = (struct gnode *) osi_AllocSmallSpace(sizeof(struct gnode));
bzero((char *)gnodepnt, sizeof(struct gnode));
memset((char *)gnodepnt, 0, sizeof(struct gnode));
#endif
#ifdef AFS_SGI64_ENV
bzero((void*)&(tvc->vc_bhv_desc), sizeof(tvc->vc_bhv_desc));
memset((void*)&(tvc->vc_bhv_desc), 0, sizeof(tvc->vc_bhv_desc));
bhv_desc_init(&(tvc->vc_bhv_desc), tvc, tvc, &Afs_vnodeops);
#ifdef AFS_SGI65_ENV
vn_bhv_head_init(&(tvc->v.v_bh), "afsvp");
@ -974,8 +974,8 @@ struct vcache *afs_NewVCache(struct VenusFid *afid, struct server *serverp,
#endif
tvc->h1.dchint = 0;
osi_dnlc_purgedp(tvc); /* this may be overkill */
bzero((char *)&(tvc->quick),sizeof(struct vtodc));
bzero((char *)&(tvc->callsort),sizeof(struct afs_q));
memset((char *)&(tvc->quick), 0, sizeof(struct vtodc));
memset((char *)&(tvc->callsort), 0, sizeof(struct afs_q));
tvc->slocks = (struct SimpleLocks *)0;
i = VCHash(afid);
@ -2602,7 +2602,7 @@ void afs_vcacheInit(int astatSize)
#if !defined(AFS_OSF_ENV)
/* Allocate and thread the struct vcache entries */
tvp = (struct vcache *) afs_osi_Alloc(astatSize * sizeof(struct vcache));
bzero((char *)tvp, sizeof(struct vcache)*astatSize);
memset((char *)tvp, 0, sizeof(struct vcache)*astatSize);
Initial_freeVCList = tvp;
freeVCList = &(tvp[0]);

View File

@ -464,7 +464,7 @@ static struct volume *afs_SetupVolume(volid, aname, ve, tcell, agood, type, areq
struct fvolume *tf=0;
tv = afs_GetVolSlot();
bzero((char *)tv, sizeof(struct volume));
memset((char *)tv, 0, sizeof(struct volume));
tv->cell = tcell->cell;
RWLOCK_INIT(&tv->lock, "volume lock");
tv->next = afs_volumes[i]; /* thread into list */
@ -912,11 +912,11 @@ void InstallUVolumeEntry(struct volume *av, struct uvldbentry *ve,
ListAddrByAttributes attrs;
afsUUID uuid;
bzero((char *)&attrs, sizeof(attrs));
memset((char *)&attrs, 0, sizeof(attrs));
attrs.Mask = VLADDR_UUID;
attrs.uuid = ve->serverNumber[i];
bzero((char *)&uuid, sizeof(uuid));
bzero((char *)&addrs, sizeof(addrs));
memset((char *)&uuid, 0, sizeof(uuid));
memset((char *)&addrs, 0, sizeof(addrs));
do {
tconn = afs_ConnByMHosts(tcell->cellHosts, tcell->vlport,
tcell->cell, areq, SHARED_LOCK);

View File

@ -319,7 +319,7 @@ char *name;
#ifdef AFS_SUN5_ENV
/* On solaris the above does not resolve hostnames to full names */
if (he != (struct hostent *)0) {
bcopy(he->h_addr, ip_addr, he->h_length);
memcpy(ip_addr, he->h_addr, he->h_length);
he = gethostbyaddr(ip_addr, he->h_length, he->h_addrtype);
}
#endif
@ -1507,7 +1507,7 @@ char *a_config_filename;
fprintf(stderr,"[ %s ] Memory Allocation error 1",rn);
afsmon_Exit(25);
}
bzero(curr_host->thresh,numBytes);
memset(curr_host->thresh, 0, numBytes);
}
curr_host = curr_host->next;;
}
@ -1525,7 +1525,7 @@ char *a_config_filename;
fprintf(stderr,"[ %s ] Memory Allocation error 2",rn);
afsmon_Exit(35);
}
bzero(curr_host->thresh,numBytes);
memset(curr_host->thresh, 0, numBytes);
}
curr_host = curr_host->next;;
}
@ -1710,8 +1710,7 @@ int a_newProbeCycle; /* start of a new probe cycle ? */
/* copy hostname and probe number and probe time and probe status.
if the probe failed return now */
bcopy(xstat_fs_Results.connP->hostName, tmp_fsPR->connP->hostName,
sizeof(xstat_fs_Results.connP->hostName));
memcpy(tmp_fsPR->connP->hostName, xstat_fs_Results.connP->hostName, sizeof(xstat_fs_Results.connP->hostName));
tmp_fsPR->probeNum = xstat_fs_Results.probeNum;
tmp_fsPR->probeTime = xstat_fs_Results.probeTime;
tmp_fsPR->probeOK = xstat_fs_Results.probeOK;
@ -1722,23 +1721,14 @@ int a_newProbeCycle; /* start of a new probe cycle ? */
}
/* copy connection information */
#if defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
bcopy(&(xstat_fs_Results.connP->skt), &(tmp_fsPR->connP->skt),
sizeof(struct sockaddr_in));
#else
bcopy(xstat_fs_Results.connP->skt, tmp_fsPR->connP->skt,
sizeof(struct sockaddr_in));
#endif
memcpy(&(tmp_fsPR->connP->skt), &(xstat_fs_Results.connP->skt), sizeof(struct sockaddr_in));
bcopy(xstat_fs_Results.connP->hostName, tmp_fsPR->connP->hostName,
sizeof(xstat_fs_Results.connP->hostName));
memcpy(tmp_fsPR->connP->hostName, xstat_fs_Results.connP->hostName, sizeof(xstat_fs_Results.connP->hostName));
tmp_fsPR->collectionNumber = xstat_fs_Results.collectionNumber;
/* copy the probe data information */
tmp_fsPR->data.AFS_CollData_len = xstat_fs_Results.data.AFS_CollData_len;
bcopy(xstat_fs_Results.data.AFS_CollData_val,
tmp_fsPR->data.AFS_CollData_val,
xstat_fs_Results.data.AFS_CollData_len * sizeof(afs_int32));
memcpy(tmp_fsPR->data.AFS_CollData_val, xstat_fs_Results.data.AFS_CollData_val, xstat_fs_Results.data.AFS_CollData_len * sizeof(afs_int32));
/* we have a valid results structure so mark the list item used */
@ -2198,8 +2188,7 @@ struct xstat_fs_ProbeResults *a_fsResults;
/* backup the display data of the probe cycle that just completed -
ie., store curr_fsData in prev_fsData */
bcopy((char *)curr_fsData, (char *)prev_fsData,
(numFS * sizeof(struct fs_Display_Data)) );
memcpy((char *)prev_fsData, (char *)curr_fsData, (numFS * sizeof(struct fs_Display_Data)) );
/* initialize curr_fsData but retain the threshold flag information.
@ -2210,7 +2199,7 @@ struct xstat_fs_ProbeResults *a_fsResults;
for(i=0; i<numFS; i++) {
curr_fsDataP->probeOK = 0;
curr_fsDataP->ovfCount = 0;
bzero((char *)curr_fsDataP->data, numBytes);
memset((char *)curr_fsDataP->data, 0, numBytes);
curr_fsDataP++;
}
@ -2439,8 +2428,7 @@ int a_newProbeCycle; /* start of new probe cycle ? */
/* copy hostname and probe number and probe time and probe status.
if the probe failed return now */
bcopy(xstat_cm_Results.connP->hostName, tmp_cmPR->connP->hostName,
sizeof(xstat_cm_Results.connP->hostName));
memcpy(tmp_cmPR->connP->hostName, xstat_cm_Results.connP->hostName, sizeof(xstat_cm_Results.connP->hostName));
tmp_cmPR->probeNum = xstat_cm_Results.probeNum;
tmp_cmPR->probeTime = xstat_cm_Results.probeTime;
tmp_cmPR->probeOK = xstat_cm_Results.probeOK;
@ -2452,25 +2440,16 @@ int a_newProbeCycle; /* start of new probe cycle ? */
/* copy connection information */
#if defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
bcopy(&(xstat_cm_Results.connP->skt), &(tmp_cmPR->connP->skt),
sizeof(struct sockaddr_in));
#else
bcopy(xstat_cm_Results.connP->skt, tmp_cmPR->connP->skt,
sizeof(struct sockaddr_in));
#endif
memcpy(&(tmp_cmPR->connP->skt), &(xstat_cm_Results.connP->skt), sizeof(struct sockaddr_in));
/**** NEED TO COPY rx_connection INFORMATION HERE ******/
bcopy(xstat_cm_Results.connP->hostName, tmp_cmPR->connP->hostName,
sizeof(xstat_cm_Results.connP->hostName));
memcpy(tmp_cmPR->connP->hostName, xstat_cm_Results.connP->hostName, sizeof(xstat_cm_Results.connP->hostName));
tmp_cmPR->collectionNumber = xstat_cm_Results.collectionNumber;
/* copy the probe data information */
tmp_cmPR->data.AFSCB_CollData_len = xstat_cm_Results.data.AFSCB_CollData_len;
bcopy(xstat_cm_Results.data.AFSCB_CollData_val,
tmp_cmPR->data.AFSCB_CollData_val,
xstat_cm_Results.data.AFSCB_CollData_len * sizeof(afs_int32));
memcpy(tmp_cmPR->data.AFSCB_CollData_val, xstat_cm_Results.data.AFSCB_CollData_val, xstat_cm_Results.data.AFSCB_CollData_len * sizeof(afs_int32));
/* we have a valid results structure so mark the list item used */
@ -2953,8 +2932,7 @@ struct xstat_cm_ProbeResults *a_cmResults;
/* backup the display data of the probe cycle that just completed -
ie., store curr_cmData in prev_cmData */
bcopy((char *)curr_cmData, (char *)prev_cmData,
(numCM * sizeof(struct cm_Display_Data)) );
memcpy((char *)prev_cmData, (char *)curr_cmData, (numCM * sizeof(struct cm_Display_Data)) );
/* initialize curr_cmData but retain the threshold flag information.
@ -2965,7 +2943,7 @@ struct xstat_cm_ProbeResults *a_cmResults;
for(i=0; i<numCM; i++) {
curr_cmDataP->probeOK = 0;
curr_cmDataP->ovfCount = 0;
bzero((char *)curr_cmDataP->data, numBytes);
memset((char *)curr_cmDataP->data, 0, numBytes);
curr_cmDataP++;
}
@ -3359,7 +3337,7 @@ init_print_buffers()
fprintf(stderr,"[ %s ] Memory allocation failure\n",rn);
return(-1);
}
bzero(curr_fsData,numBytes);
memset(curr_fsData, 0, numBytes);
numBytes = numFS * sizeof(struct fs_Display_Data);
prev_fsData = (struct fs_Display_Data *) malloc(numBytes);
@ -3367,7 +3345,7 @@ init_print_buffers()
fprintf(stderr,"[ %s ] Memory allocation failure\n",rn);
return(-5);
}
bzero(prev_fsData,numBytes);
memset(prev_fsData, 0, numBytes);
/* fill in the host names */
tmp_fsData1 = curr_fsData;
@ -3394,7 +3372,7 @@ init_print_buffers()
fprintf(stderr,"[ %s ] Memory allocation failure\n",rn);
return(-10);
}
bzero(curr_cmData,numBytes);
memset(curr_cmData, 0, numBytes);
numBytes = numCM * sizeof(struct cm_Display_Data);
prev_cmData = (struct cm_Display_Data *) malloc(numBytes);
@ -3402,7 +3380,7 @@ init_print_buffers()
fprintf(stderr,"[ %s ] Memory allocation failure\n",rn);
return(-15);
}
bzero(prev_cmData,numBytes);
memset(prev_cmData, 0, numBytes);
/* fill in the host names */
tmp_cmData1 = curr_cmData;
@ -3496,7 +3474,7 @@ afsmon_execute()
return(-1);
}
bzero(FSSktArray, FSsktbytes);
memset(FSSktArray, 0, FSsktbytes);
/* Fill in the socket information for each fileserve */
@ -3510,7 +3488,7 @@ afsmon_execute()
return(-1);
}
strncpy(curr_FS->hostName,he->h_name,HOST_NAME_LEN); /* complete name*/
bcopy(he->h_addr, &(curr_skt->sin_addr.s_addr), 4);
memcpy(&(curr_skt->sin_addr.s_addr), he->h_addr, 4);
curr_skt->sin_family = htons(AF_INET); /*Internet family*/
curr_skt->sin_port = htons(7000); /*FileServer port*/
@ -3567,7 +3545,7 @@ afsmon_execute()
return(-1);
}
bzero(CMSktArray, CMsktbytes);
memset(CMSktArray, 0, CMsktbytes);
/* Fill in the socket information for each CM */
@ -3581,7 +3559,7 @@ afsmon_execute()
return(-1);
}
strncpy(curr_CM->hostName,he->h_name,HOST_NAME_LEN); /* complete name*/
bcopy(he->h_addr, &(curr_skt->sin_addr.s_addr), 4);
memcpy(&(curr_skt->sin_addr.s_addr), he->h_addr, 4);
curr_skt->sin_family = htons(AF_INET); /*Internet family*/
curr_skt->sin_port = htons(7001); /*Cache Manager port*/

View File

@ -473,10 +473,10 @@ int getTokenLen(char *buf)
afs_int32 EndTimestamp;
} token;
tp=buf;
bcopy(tp, &len, sizeof(afs_int32)); /* get size of secret token */
memcpy(&len, tp, sizeof(afs_int32)); /* get size of secret token */
rc=(len+sizeof(afs_int32));
tp += (sizeof(afs_int32) + len); /* skip secret token and its length */
bcopy(tp, &len, sizeof(afs_int32)); /* get size of clear token */
memcpy(&len, tp, sizeof(afs_int32)); /* get size of clear token */
if (len != sizeof(struct ClearToken)) {
#ifdef DEBUG
fprintf(stderr, "apache_afs_cache.c:getExpiration:"
@ -508,9 +508,9 @@ long getExpiration(char *buf)
} token;
tp = buf;
bcopy(tp, &len, sizeof(afs_int32)); /* get size of secret token */
memcpy(&len, tp, sizeof(afs_int32)); /* get size of secret token */
tp += (sizeof(afs_int32) + len); /* skip secret token and its length */
bcopy(tp, &len, sizeof(afs_int32)); /* get size of clear token */
memcpy(&len, tp, sizeof(afs_int32)); /* get size of clear token */
if (len != sizeof(struct ClearToken)) {
#ifdef DEBUG
fprintf(stderr, "apache_afs_cache.c:getExpiration:"
@ -520,6 +520,6 @@ long getExpiration(char *buf)
}
tp += sizeof(afs_int32); /* skip length of clear token */
bcopy(tp, &token, sizeof(struct ClearToken)); /* copy the token */
memcpy(&token, tp, sizeof(struct ClearToken)); /* copy the token */
return token.EndTimestamp;
}

View File

@ -376,17 +376,17 @@ static int setToken(char *tokenBuf, int tokenLen)
#ifdef OLDSETPAG
/* skip over the secret token */
temp = tokenBuf;
bcopy(temp, &i, sizeof(afs_int32));
memcpy(&i, temp, sizeof(afs_int32));
temp += (i + sizeof(afs_int32));
/* skip over the clear token */
bcopy(temp, &i, sizeof(afs_int32));
memcpy(&i, temp, sizeof(afs_int32));
temp += (i + sizeof(afs_int32));
doneSETPAG = 1;
bcopy(temp, &i, sizeof(afs_int32));
memcpy(&i, temp, sizeof(afs_int32));
i |= 0x8000;
bcopy(&i, temp, sizeof(afs_int32));
memcpy(temp, &i, sizeof(afs_int32));
temp += sizeof(afs_int32);
#endif
@ -455,9 +455,9 @@ int authenticateUser(request_rec *r, char *defaultCell,
strcpy(global_default_cell, defaultCell);
}
bzero(user,APACHEAFS_USERNAME_MAX);
bzero(passwd,APACHEAFS_PASSWORD_MAX);
bzero(cell,APACHEAFS_CELLNAME_MAX);
memset(user, 0, APACHEAFS_USERNAME_MAX);
memset(passwd, 0, APACHEAFS_PASSWORD_MAX);
memset(cell, 0, APACHEAFS_CELLNAME_MAX);
if (auth_line == NULL) { /* No Authorization field - we don't do anything */
/*
@ -468,9 +468,9 @@ int authenticateUser(request_rec *r, char *defaultCell,
afslog(15, ("%s: No authline recieved", module_name));
haveAuth = 0;
userChanged=1;
bzero(lastUser, APACHEAFS_USERNAME_MAX);
bzero(lastCell, APACHEAFS_CELLNAME_MAX);
bzero(lastCksum, SHA_HASH_BYTES);
memset(lastUser, 0, APACHEAFS_USERNAME_MAX);
memset(lastCell, 0, APACHEAFS_CELLNAME_MAX);
memset(lastCksum, 0, SHA_HASH_BYTES);
rc = unlog();
afslog(25, ("%s: pid:%d No Authorization field. Unlogging ...",
module_name, getpid()));
@ -503,9 +503,9 @@ int authenticateUser(request_rec *r, char *defaultCell,
module_name, getpid()));
haveAuth = 0;
userChanged = 1;
bzero(lastUser, APACHEAFS_USERNAME_MAX);
bzero(lastCell, APACHEAFS_CELLNAME_MAX);
bzero(lastCksum, SHA_HASH_BYTES);
memset(lastUser, 0, APACHEAFS_USERNAME_MAX);
memset(lastCell, 0, APACHEAFS_CELLNAME_MAX);
memset(lastCksum, 0, SHA_HASH_BYTES);
rc = unlog();
if (rc) {
sprintf(err_msg, "%s: Error unlogging from AFS cell - rc: %d, errno:%d",
@ -773,7 +773,7 @@ static int geturi(request_rec *r, char *buf)
afsassert(r);
afsassert(buf);
bzero(buf, APACHEAFS_CELLNAME_MAX);
memset(buf, 0, APACHEAFS_CELLNAME_MAX);
pos = strchr(r->uri,'/');
if (pos != NULL) {
pos++;
@ -820,7 +820,7 @@ static int parseAuthName_int(request_rec *r, char *buf, char *msg)
afsassert(buf);
afsassert(msg);
bzero(blank, sizeof(blank));
memset(blank, 0, sizeof(blank));
afslog(50, ("%s: Parsing Authorization Required reply. buf:%s", module_name, buf));
pos = strchr(buf, '<');
@ -873,7 +873,7 @@ static int parseAuthName_int(request_rec *r, char *buf, char *msg)
pos++;
strcat(msg, pos);
strcpy(buf, msg);
bzero(msg, 1024);
memset(msg, 0, 1024);
parseAuthName_int(r, buf, msg);
return 0;
}
@ -899,7 +899,7 @@ static int parseAuthName(request_rec *r, char *buf)
afsassert(r);
afsassert(buf);
bzero(msg, sizeof(msg));
memset(msg, 0, sizeof(msg));
pos=strchr(buf,'<');
while (pos != NULL) {
@ -910,7 +910,7 @@ static int parseAuthName(request_rec *r, char *buf)
return -1;
}
strcpy(buf, msg);
bzero(msg, sizeof(msg));
memset(msg, 0, sizeof(msg));
pos = strchr(buf, '<');
}
afslog(50, ("%s: Parsing WWW Auth required reply. final message:%s",

View File

@ -74,17 +74,17 @@ flipPrimary(char *tokenBuf)
char * temp = tokenBuf;
/* skip over the secret token */
bcopy(temp, &i, sizeof(afs_int32));
memcpy(&i, temp, sizeof(afs_int32));
temp += (i + sizeof(afs_int32));
/* skip over the clear token */
bcopy(temp, &i, sizeof(afs_int32));
memcpy(&i, temp, sizeof(afs_int32));
temp += (i + sizeof(afs_int32));
/* set the primary flag */
bcopy(temp, &i, sizeof(afs_int32));
memcpy(&i, temp, sizeof(afs_int32));
i |= 0x8000;
bcopy(&i, temp, sizeof(afs_int32));
memcpy(temp, &i, sizeof(afs_int32));
temp += sizeof(afs_int32);
return 0;
}
@ -222,21 +222,21 @@ void parseToken(char *buf)
assert ( buf != NULL );
tp = buf;
bcopy(tp, &len, sizeof(afs_int32)); /* get size of secret token */
memcpy(&len, tp, sizeof(afs_int32)); /* get size of secret token */
tp += (sizeof(afs_int32)+ len); /* skip secret token */
bcopy(tp, &len, sizeof(afs_int32)); /* get size of clear token */
memcpy(&len, tp, sizeof(afs_int32)); /* get size of clear token */
if (len != sizeof(struct ClearToken)) {
fprintf(stderr, "weblog:parseToken: error getting length of ClearToken\n");
return;
}
tp += sizeof(afs_int32); /* skip length of cleartoken */
bcopy(tp, &clearToken, sizeof(struct ClearToken)); /* copy cleartoken */
memcpy(&clearToken, tp, sizeof(struct ClearToken)); /* copy cleartoken */
tp += len; /* skip clear token itself */
bcopy(tp, &len, sizeof(afs_int32)); /* copy the primary flag */
memcpy(&len, tp, sizeof(afs_int32)); /* copy the primary flag */
tp += sizeof(afs_int32); /* skip primary flag */
/* tp now points to the cell name */

View File

@ -87,7 +87,9 @@ char *mktemp(char *template);
#include <sys/time.h>
#define NEED_STRERROR
typedef int rlim_t;
#define memmove(a,b,c) bcopy(b,a,c)
#ifndef HAVE_MEMMOVE
#define memmove(a,b,c) memcpy(a, b, c)
#endif
#define NO_LINGCLOSE
#define USE_FLOCK_SERIALIZED_ACCEPT
@ -96,7 +98,6 @@ typedef int rlim_t;
#define NO_KILLPG
#undef NO_SETSID
#define HAVE_SYS_RESOURCE_H
#define bzero(a,b) memset(a,0,b)
#define JMP_BUF sigjmp_buf
#define USE_FCNTL_SERIALIZED_ACCEPT
#define HAVE_MMAP
@ -299,7 +300,7 @@ extern int strncasecmp(const char *,const char *,unsigned);
/* These are to let -Wall compile more cleanly */
extern int strcasecmp(const char *, const char *);
extern int strncasecmp(const char *,const char *,unsigned);
extern int set42sig(), getopt(), getpeername(), bzero();
extern int set42sig(), getopt(), getpeername();
extern int listen(), bind(), socket(), getsockname();
extern int accept(), gethostname(), connect(), lstat();
extern int select(), killpg(), shutdown();
@ -335,7 +336,6 @@ extern char *crypt();
#undef NEED_STRDUP
#define NEED_STRCASECMP
#define NEED_STRNCASECMP
#define bzero(a,b) memset(a,0,b)
#define JMP_BUF sigjmp_buf
/* A lot of SVR4 systems need this */
#define USE_FCNTL_SERIALIZED_ACCEPT
@ -347,7 +347,6 @@ extern char *crypt();
#undef NEED_STRDUP
#define NEED_STRCASECMP
#define NEED_STRNCASECMP
#define bzero(a,b) memset(a,0,b)
#define JMP_BUF sigjmp_buf
#define HAVE_RESOURCE
#define HAVE_MMAP
@ -364,7 +363,6 @@ extern char *crypt();
#undef NEED_STRDUP
#define NEED_STRCASECMP
#define NEED_STRNCASECMP
#define bzero(a,b) memset(a,0,b)
#define JMP_BUF sigjmp_buf
/* A lot of SVR4 systems need this */
#define USE_FCNTL_SERIALIZED_ACCEPT
@ -447,7 +445,6 @@ int initgroups (char *, int);
#define NO_KILLPG
#undef NO_SETSID
#define HAVE_RESOURCE 1
#define bzero(a,b) memset(a,0,b)
#define JMP_BUF sigjmp_buf
#define USE_FCNTL_SERIALIZED_ACCEPT
#define HAVE_MMAP

View File

@ -141,7 +141,9 @@ char *mktemp(char *template);
#include <sys/time.h>
#define NEED_STRERROR
typedef int rlim_t;
#define memmove(a,b,c) bcopy(b,a,c)
#ifndef HAVE_MEMMOVE
#define memmove(a,b,c) memcpy(a, b, c)
#endif
#define NO_LINGCLOSE
#define USE_FLOCK_SERIALIZED_ACCEPT
#define NEED_DIFFTIME
@ -151,7 +153,6 @@ typedef int rlim_t;
#undef HAVE_GMTOFF
#define NO_KILLPG
#undef NO_SETSID
#define bzero(a,b) memset(a,0,b)
#if !defined(USE_SYSVSEM_SERIALIZED_ACCEPT) && \
!defined(USE_PTHREAD_SERIALIZED_ACCEPT)
#define USE_FCNTL_SERIALIZED_ACCEPT
@ -252,7 +253,7 @@ typedef int rlim_t;
#endif
#define USE_FCNTL_SERIALIZED_ACCEPT
#ifdef USEBCOPY
#define memmove(a,b,c) bcopy(b,a,c)
#define memmove(a,b,c) memcpy(a, b, c)
#endif
#if AIX >= 42
#define NET_SIZE_T size_t
@ -446,7 +447,7 @@ extern int strncasecmp(const char *, const char *, unsigned);
/* These are to let -Wall compile more cleanly */
extern int strcasecmp(const char *, const char *);
extern int strncasecmp(const char *, const char *, unsigned);
extern int set42sig(), getopt(), getpeername(), bzero();
extern int set42sig(), getopt(), getpeername();
extern int listen(), bind(), socket(), getsockname();
extern int accept(), gethostname(), connect(), lstat();
extern int select(), killpg(), shutdown();
@ -489,7 +490,6 @@ extern char *crypt();
#define NEED_STRNCASECMP
#endif /* ENCORE */
#endif /* MPRAS */
#define bzero(a,b) memset(a,0,b)
/* A lot of SVR4 systems need this */
#ifndef USE_SYSVSEM_SERIALIZED_ACCEPT
#define USE_FCNTL_SERIALIZED_ACCEPT
@ -513,7 +513,6 @@ extern char *crypt();
#undef NEED_STRDUP
#define NEED_STRCASECMP
#define NEED_STRNCASECMP
#define bzero(a,b) memset(a,0,b)
#define HAVE_MMAP 1
#define USE_MMAP_SCOREBOARD
#define USE_MMAP_FILES
@ -533,7 +532,6 @@ extern char *crypt();
#undef NEED_STRDUP
#define NEED_STRCASECMP
#define NEED_STRNCASECMP
#define bzero(a,b) memset(a,0,b)
/* A lot of SVR4 systems need this */
#define USE_FCNTL_SERIALIZED_ACCEPT
#define ap_inet_addr inet_network
@ -653,7 +651,6 @@ typedef int rlim_t;
#undef HAVE_GMTOFF
#define NO_KILLPG
#undef NO_SETSID
#define bzero(a,b) memset(a,0,b)
#define USE_FCNTL_SERIALIZED_ACCEPT
#define HAVE_MMAP 1
#define USE_MMAP_SCOREBOARD

View File

@ -166,7 +166,9 @@ char *mktemp(char *template);
#include <sys/time.h>
#define NEED_STRERROR
typedef int rlim_t;
#define memmove(a,b,c) bcopy(b,a,c)
#ifndef HAVE_MEMMOVE
#define memmove(a,b,c) memcpy(a, b, c)
#endif
#define NO_LINGCLOSE
#define USE_FLOCK_SERIALIZED_ACCEPT
#define NEED_DIFFTIME
@ -176,7 +178,6 @@ typedef int rlim_t;
#undef HAVE_GMTOFF
#define NO_KILLPG
#undef NO_SETSID
#define bzero(a,b) memset(a,0,b)
#if !defined(USE_SYSVSEM_SERIALIZED_ACCEPT) && \
!defined(USE_PTHREAD_SERIALIZED_ACCEPT)
#define USE_FCNTL_SERIALIZED_ACCEPT
@ -277,7 +278,7 @@ typedef int rlim_t;
#endif
#define USE_FCNTL_SERIALIZED_ACCEPT
#ifdef USEBCOPY
#define memmove(a,b,c) bcopy(b,a,c)
#define memmove(a,b,c) memcpy(a, b, c)
#endif
#if AIX >= 42
#define NET_SIZE_T size_t
@ -517,7 +518,7 @@ extern int strncasecmp(const char *, const char *, unsigned);
/* These are to let -Wall compile more cleanly */
extern int strcasecmp(const char *, const char *);
extern int strncasecmp(const char *, const char *, unsigned);
extern int set42sig(), getopt(), getpeername(), bzero();
extern int set42sig(), getopt(), getpeername();
extern int listen(), bind(), socket(), getsockname();
extern int accept(), gethostname(), connect(), lstat();
extern int select(), killpg(), shutdown();
@ -560,7 +561,6 @@ extern char *crypt();
#define NEED_STRNCASECMP
#endif /* ENCORE */
#endif /* MPRAS */
#define bzero(a,b) memset(a,0,b)
/* A lot of SVR4 systems need this */
#ifndef USE_SYSVSEM_SERIALIZED_ACCEPT
#define USE_FCNTL_SERIALIZED_ACCEPT
@ -589,7 +589,6 @@ extern char *crypt();
#undef NEED_STRDUP
#define NEED_STRCASECMP
#define NEED_STRNCASECMP
#define bzero(a,b) memset(a,0,b)
#define HAVE_MMAP 1
#define USE_MMAP_SCOREBOARD
#define USE_MMAP_FILES
@ -613,7 +612,6 @@ extern char *crypt();
#define NEED_STRCASECMP
#define NEED_STRNCASECMP
#endif
#define bzero(a,b) memset(a,0,b)
/* A lot of SVR4 systems need this */
#define USE_FCNTL_SERIALIZED_ACCEPT
#define ap_inet_addr inet_network
@ -737,7 +735,6 @@ typedef int rlim_t;
#undef HAVE_GMTOFF
#define NO_KILLPG
#undef NO_SETSID
#define bzero(a,b) memset(a,0,b)
#define USE_FCNTL_SERIALIZED_ACCEPT
#define HAVE_MMAP 1
#define USE_MMAP_SCOREBOARD

View File

@ -87,7 +87,9 @@ char *mktemp(char *template);
#include <sys/time.h>
#define NEED_STRERROR
typedef int rlim_t;
#define memmove(a,b,c) bcopy(b,a,c)
#ifndef HAVE_MEMMOVE
#define memmove(a,b,c) memcpy(a, b, c)
#endif
#define NO_LINGCLOSE
#define USE_FLOCK_SERIALIZED_ACCEPT
@ -96,7 +98,6 @@ typedef int rlim_t;
#define NO_KILLPG
#undef NO_SETSID
#define HAVE_SYS_RESOURCE_H
#define bzero(a,b) memset(a,0,b)
#define JMP_BUF sigjmp_buf
#define USE_FCNTL_SERIALIZED_ACCEPT
#define HAVE_MMAP
@ -299,7 +300,7 @@ extern int strncasecmp(const char *,const char *,unsigned);
/* These are to let -Wall compile more cleanly */
extern int strcasecmp(const char *, const char *);
extern int strncasecmp(const char *,const char *,unsigned);
extern int set42sig(), getopt(), getpeername(), bzero();
extern int set42sig(), getopt(), getpeername();
extern int listen(), bind(), socket(), getsockname();
extern int accept(), gethostname(), connect(), lstat();
extern int select(), killpg(), shutdown();
@ -335,7 +336,6 @@ extern char *crypt();
#undef NEED_STRDUP
#define NEED_STRCASECMP
#define NEED_STRNCASECMP
#define bzero(a,b) memset(a,0,b)
#define JMP_BUF sigjmp_buf
/* A lot of SVR4 systems need this */
#define USE_FCNTL_SERIALIZED_ACCEPT
@ -347,7 +347,6 @@ extern char *crypt();
#undef NEED_STRDUP
#define NEED_STRCASECMP
#define NEED_STRNCASECMP
#define bzero(a,b) memset(a,0,b)
#define JMP_BUF sigjmp_buf
#define HAVE_RESOURCE
#define HAVE_MMAP
@ -364,7 +363,6 @@ extern char *crypt();
#undef NEED_STRDUP
#define NEED_STRCASECMP
#define NEED_STRNCASECMP
#define bzero(a,b) memset(a,0,b)
#define JMP_BUF sigjmp_buf
/* A lot of SVR4 systems need this */
#define USE_FCNTL_SERIALIZED_ACCEPT
@ -447,7 +445,6 @@ int initgroups (char *, int);
#define NO_KILLPG
#undef NO_SETSID
#define HAVE_RESOURCE 1
#define bzero(a,b) memset(a,0,b)
#define JMP_BUF sigjmp_buf
#define USE_FCNTL_SERIALIZED_ACCEPT
#define HAVE_MMAP

View File

@ -338,7 +338,7 @@ static int store_afs_token(unix_id, realm_p, tkt_type, ticket_p, ticket_len,
token.startTime = starttime;
token.endTime = endtime;
bcopy(session_key, (char *) &token.sessionKey, sizeof(token.sessionKey));
memcpy((char *) &token.sessionKey, session_key, sizeof(token.sessionKey));
token.kvno = tkt_type;
token.ticketLen = ticket_len;
if (ticket_len > MAXKTCTICKETLEN) {
@ -346,7 +346,7 @@ static int store_afs_token(unix_id, realm_p, tkt_type, ticket_p, ticket_len,
"Maximum length accepted by AFS cache manager is %d\n", MAXKTCTICKETLEN);
return -1;
}
bcopy((char *) ticket_p, (char *) token.ticket, ticket_len);
memcpy((char *) token.ticket, (char *) ticket_p, ticket_len);
sprintf(client.name, "AFS ID %d", unix_id);
strcpy(client.instance, "");
@ -370,7 +370,7 @@ static char *make_string(s_p, length)
fprintf(stderr, "dlog: out of memory\n");
exit(1);
}
bcopy(s_p, new_p, length);
memcpy(new_p, s_p, length);
new_p[length] = '\0';
return new_p;
}
@ -493,7 +493,7 @@ static int decode_reply(buf, buflen, reply_p)
case ASN_OCTET_STRING:
if (context == 1 && len == sizeof(reply_p->session_key)) {
saw_session_key++;
bcopy(buf, reply_p->session_key, len);
memcpy(reply_p->session_key, buf, len);
}
buf += len;
break;
@ -710,7 +710,7 @@ static int getDFScreds(char *name, char *realm, char *passwd,
des_string_to_key(passwd, passwd_key);
/* Destroy the password. */
bzero(passwd, strlen(passwd));
memset(passwd, 0, strlen(passwd));
/*
@ -731,8 +731,8 @@ static int getDFScreds(char *name, char *realm, char *passwd,
/*
* Destroy the key block: it's no longer needed.
*/
bzero(schedule, sizeof(schedule));
bzero(passwd_key, sizeof(passwd_key));
memset(schedule, 0, sizeof(schedule));
memset(passwd_key, 0, sizeof(passwd_key));
/*
@ -811,7 +811,7 @@ CommandProc (as, arock)
char type[10]; /* authentication type AFS or DFS */
/* blow away command line arguments */
for (i=1; i<zero_argc; i++) bzero (zero_argv[i], strlen(zero_argv[i]));
for (i=1; i<zero_argc; i++) memset(zero_argv[i], 0, strlen(zero_argv[i]));
zero_argc = 0;
/* first determine quiet flag based on -silent switch */

View File

@ -94,10 +94,10 @@ static aixmakebuf (audEvent, vaList)
case AUD_FID : /* AFSFid - contains 3 entries */
vaFid = (struct AFSFid *) va_arg(vaList, int);
if (vaFid) {
bcopy(vaFid, bufferPtr, sizeof(struct AFSFid));
memcpy(bufferPtr, vaFid, sizeof(struct AFSFid));
}
else {
bzero (bufferPtr, sizeof(struct AFSFid));
memset(bufferPtr, 0, sizeof(struct AFSFid));
}
bufferPtr += sizeof(struct AFSFid);
break;
@ -113,13 +113,13 @@ static aixmakebuf (audEvent, vaList)
if (Fids && Fids->AFSCBFids_len) {
*((u_int *)bufferPtr) = Fids->AFSCBFids_len;
bufferPtr += sizeof(u_int);
bcopy(Fids->AFSCBFids_val, bufferPtr, sizeof(struct AFSFid));
memcpy(bufferPtr, Fids->AFSCBFids_val, sizeof(struct AFSFid));
}
else {
struct AFSFid dummy;
*((u_int *)bufferPtr) = 0;
bufferPtr += sizeof(u_int);
bzero (bufferPtr, sizeof(struct AFSFid));
memset(bufferPtr, 0, sizeof(struct AFSFid));
}
bufferPtr += sizeof(struct AFSFid);
break;

View File

@ -224,7 +224,7 @@ register char *adir; {
LOCK_GLOBAL_MUTEX
/* zero structure and fill in name; rest is done by internal routine */
tdir = (struct afsconf_dir *) malloc(sizeof(struct afsconf_dir));
bzero(tdir, sizeof(struct afsconf_dir));
memset(tdir, 0, sizeof(struct afsconf_dir));
tdir->name = (char *) malloc(strlen(adir)+1);
strcpy(tdir->name, adir);
@ -401,7 +401,7 @@ char clones[];
curEntry = 0;
}
curEntry = (struct afsconf_entry *) malloc(sizeof(struct afsconf_entry));
bzero(curEntry, sizeof(struct afsconf_entry));
memset(curEntry, 0, sizeof(struct afsconf_entry));
code = ParseCellLine(tbuffer, curEntry->cellInfo.name, linkedcell);
if (code) {
afsconf_CloseInternal(adir);
@ -781,7 +781,7 @@ register struct afsconf_dir *adir; {
if (adir->keystr) free(adir->keystr);
/* reinit */
bzero(adir, sizeof(struct afsconf_dir));
memset(adir, 0, sizeof(struct afsconf_dir));
adir->name = tname; /* restore it */
return 0;
}
@ -858,7 +858,7 @@ struct afsconf_keys *astr;
code = afsconf_Check(adir);
if (code)
return AFSCONF_FAILURE;
bcopy(adir->keystr, astr, sizeof(struct afsconf_keys));
memcpy(astr, adir->keystr, sizeof(struct afsconf_keys));
UNLOCK_GLOBAL_MUTEX
return 0;
}
@ -892,7 +892,7 @@ afs_int32 afsconf_GetLatestKey(adir, avno, akey)
}
}
if (bestk) { /* found any */
if (akey) bcopy(bestk->key, akey, 8); /* copy out latest key */
if (akey) memcpy(akey, bestk->key, 8); /* copy out latest key */
if (avno) *avno = bestk->kvno; /* and kvno to caller */
UNLOCK_GLOBAL_MUTEX
return 0;
@ -919,7 +919,7 @@ char *akey;
for(tk = adir->keystr->key,i=0;i<maxa;i++,tk++) {
if (tk->kvno == avno) {
bcopy(tk->key, akey, 8);
memcpy(akey, tk->key, 8);
UNLOCK_GLOBAL_MUTEX
return 0;
}
@ -938,7 +938,7 @@ struct afsconf_dir *adir;
register afs_int32 i;
char tbuffer[256];
bcopy(adir->keystr, &tkeys, sizeof(struct afsconf_keys));
memcpy(&tkeys, adir->keystr, sizeof(struct afsconf_keys));
/* convert it to net byte order */
for(i = 0; i<tkeys.nkeys; i++ )
@ -996,7 +996,7 @@ char akey[8];
tkey = &tk->key[tk->nkeys++];
}
tkey->kvno = akvno;
bcopy(akey, tkey->key, 8);
memcpy(tkey->key, akey, 8);
i = SaveKeys(adir);
afsconf_Touch(adir);
UNLOCK_GLOBAL_MUTEX
@ -1032,7 +1032,7 @@ afs_int32 akvno;
/* otherwise slide the others down. i and tkey point at the guy to delete */
for(;i<tk->nkeys-1; i++,tkey++) {
tkey->kvno = (tkey+1)->kvno;
bcopy((tkey+1)->key, tkey->key, 8);
memcpy(tkey->key, (tkey+1)->key, 8);
}
tk->nkeys--;
i = SaveKeys(adir);

View File

@ -275,7 +275,7 @@ afs_int32 flags;
else /* valid, but no match */ ;
} else found = i; /* remember this empty slot */
if (found == -1) return KTC_NOENT;
bcopy (atoken, &local_tokens[found].token, sizeof(struct ktc_token));
memcpy(&local_tokens[found].token, atoken, sizeof(struct ktc_token));
local_tokens[found].server = *aserver;
local_tokens[found].client = *aclient;
local_tokens[found].valid = 1;
@ -284,13 +284,13 @@ afs_int32 flags;
tp = tbuffer; /* start copying here */
if ((atoken->ticketLen < MINKTCTICKETLEN) ||
(atoken->ticketLen > MAXKTCTICKETLEN)) return KTC_TOOBIG;
bcopy(&atoken->ticketLen, tp, sizeof(afs_int32)); /* copy in ticket length */
memcpy(tp, &atoken->ticketLen, sizeof(afs_int32)); /* copy in ticket length */
tp += sizeof(afs_int32);
bcopy(atoken->ticket, tp, atoken->ticketLen); /* copy in ticket */
memcpy(tp, atoken->ticket, atoken->ticketLen); /* copy in ticket */
tp += atoken->ticketLen;
/* next, copy in the "clear token", describing who we are */
ct.AuthHandle = atoken->kvno; /* hide auth handle here */
bcopy(&atoken->sessionKey, ct.HandShakeKey, 8);
memcpy(ct.HandShakeKey, &atoken->sessionKey, 8);
ct.BeginTimestamp = atoken->startTime;
ct.EndTimestamp = atoken->endTime;
@ -326,9 +326,9 @@ not_vice_id:
#endif
temp = sizeof(struct ClearToken);
bcopy(&temp, tp, sizeof(afs_int32));
memcpy(tp, &temp, sizeof(afs_int32));
tp += sizeof(afs_int32);
bcopy(&ct, tp, sizeof(struct ClearToken));
memcpy(tp, &ct, sizeof(struct ClearToken));
tp += sizeof(struct ClearToken);
/* next copy in primary flag */
@ -344,7 +344,7 @@ not_vice_id:
if (flags & AFS_SETTOK_SETPAG)
temp |= 0x8000;
bcopy(&temp, tp, sizeof(afs_int32));
memcpy(tp, &temp, sizeof(afs_int32));
tp += sizeof(afs_int32);
/* finally copy in the cell name */
@ -478,7 +478,7 @@ struct ktc_token *atoken; {
(strcmp (local_tokens[i].server.name, aserver->name) == 0) &&
(strcmp (local_tokens[i].server.instance, aserver->instance) == 0) &&
(strcmp (local_tokens[i].server.cell, aserver->cell) == 0)) {
bcopy (&local_tokens[i].token, atoken, min (atokenLen, sizeof(struct ktc_token)));
memcpy (atoken, &local_tokens[i].token, min (atokenLen, sizeof(struct ktc_token)));
if (aclient)
*aclient = local_tokens[i].client;
UNLOCK_GLOBAL_MUTEX
@ -508,7 +508,7 @@ struct ktc_token *atoken; {
if (aclient)
strcpy(aclient->cell, lcell);
bcopy(&ctoken, atoken,
memcpy(atoken, &ctoken,
min (atokenLen, sizeof(struct ktc_token)));
afs_tf_close();
@ -762,10 +762,10 @@ struct ktc_principal *aserver; {
/* next iterator determined by earlier loop */
*aindex = index+1;
bcopy(tp, &temp, sizeof(afs_int32)); /* get size of secret token */
memcpy(&temp, tp, sizeof(afs_int32)); /* get size of secret token */
tp += sizeof(afs_int32);
tp += temp; /* skip ticket for now */
bcopy(tp, &temp, sizeof(afs_int32)); /* get size of clear token */
memcpy(&temp, tp, sizeof(afs_int32)); /* get size of clear token */
if (temp != sizeof(struct ClearToken)) {
UNLOCK_GLOBAL_MUTEX
return KTC_ERROR;
@ -1164,7 +1164,7 @@ afs_tf_close()
(void) close(fd);
fd = -1; /* see declaration of fd above */
}
bzero(tfbfr, sizeof(tfbfr));
memset(tfbfr, 0, sizeof(tfbfr));
}
/*
@ -1446,7 +1446,7 @@ afs_tf_create(pname,pinst)
if ((fd = open(file, O_RDWR, 0)) < 0)
goto out; /* can't zero it, but we can still try truncating it */
bzero(zerobuf, sizeof(zerobuf));
memset(zerobuf, 0, sizeof(zerobuf));
for (i = 0; i < sbuf.st_size; i += sizeof(zerobuf))
if (write(fd, zerobuf, sizeof(zerobuf)) != sizeof(zerobuf)) {
@ -1517,7 +1517,7 @@ afs_tf_dest_tkt()
if ((fd = open(file, O_RDWR, 0)) < 0)
goto out;
bzero(buf, BUFSIZ);
memset(buf, 0, BUFSIZ);
for (i = 0; i < statb.st_size; i += BUFSIZ)
if (write(fd, buf, BUFSIZ) != BUFSIZ) {

View File

@ -77,7 +77,7 @@ char **argv; {
printf(" Ex: setkey add 0 \"80b6a7cd7a9dadb6\"\n");
exit(1);
}
bzero(tkey, sizeof(tkey));
memset(tkey, 0, sizeof(tkey));
for(i=7, cp = argv[3] + 15;i>=0; i--,cp-=2)
tkey[i] = char2hex(*cp) + char2hex(*(cp-1))*16;
@ -115,7 +115,7 @@ char **argv; {
char hexbuf[17];
unsigned char c;
int j;
bcopy(tkeys.key[i].key, tbuffer, 8);
memcpy(tbuffer, tkeys.key[i].key, 8);
tbuffer[8] = 0;
for(j=0;j<8;j++) {
c = tbuffer[j];

View File

@ -48,7 +48,7 @@ struct afsconf_dir *adir; {
printf("Cell %s:\n", ainfo->name);
for(i=0;i<ainfo->numServers;i++) {
bcopy(&ainfo->hostAddr[i].sin_addr, &temp, sizeof(long));
memcpy(&temp, &ainfo->hostAddr[i].sin_addr, sizeof(long));
printf(" host %s at %x.%x\n", ainfo->hostName[i], temp, ainfo->hostAddr[i].sin_port);
}
return 0;

View File

@ -51,7 +51,7 @@ register struct afsconf_cell *aci; {
printf("Host %s not found in host database...\n", aci->hostName[i]);
return AFSCONF_FAILURE;
}
bcopy(th->h_addr, &aci->hostAddr[i].sin_addr, sizeof(afs_int32));
memcpy(&aci->hostAddr[i].sin_addr, th->h_addr, sizeof(afs_int32));
}
/* otherwise we're deleting this entry */
}

View File

@ -281,7 +281,7 @@ struct bnode_ops *aprocs; {
}
if (!tt) {
tt = (struct bnode_type *) malloc(sizeof(struct bnode_type));
bzero(tt, sizeof(struct bnode_type));
memset(tt, 0, sizeof(struct bnode_type));
tt->next = allTypes;
allTypes = tt;
tt->name = atype;
@ -425,7 +425,7 @@ struct bnode_ops *abnodeops; {
struct bnode **lb, *nb;
/* format the bnode properly */
bzero(abnode, sizeof(struct bnode));
memset(abnode, 0, sizeof(struct bnode));
abnode->ops = abnodeops;
abnode->name = (char *) malloc(strlen(aname)+1);
strcpy(abnode->name, aname);
@ -733,13 +733,13 @@ int bnode_Init() {
if (initDone) return 0;
initDone = 1;
bzero(&bnode_stats, sizeof(bnode_stats));
memset(&bnode_stats, 0, sizeof(bnode_stats));
LWP_InitializeProcessSupport(1, &junk); /* just in case */
IOMGR_Initialize();
code = LWP_CreateProcess(bproc, BNODE_LWP_STACKSIZE,
/* priority */ 1, /* parm */0, "bnode-manager", &bproc_pid);
if (code) return code;
bzero((char *)&newaction, sizeof(newaction));
memset((char *)&newaction, 0, sizeof(newaction));
newaction.sa_handler = bnode_Int;
code = sigaction(SIGCHLD, &newaction, NULL);
if (code) return errno;
@ -831,7 +831,7 @@ char *aexecString; {
code = bnode_ParseLine(aexecString, &tlist); /* try parsing first */
if (code) return code;
tp = (struct bnode_proc *) malloc(sizeof(struct bnode_proc));
bzero(tp, sizeof(struct bnode_proc));
memset(tp, 0, sizeof(struct bnode_proc));
tp->next = allProcs;
allProcs = tp;
*aproc = tp;

View File

@ -178,7 +178,7 @@ struct cmd_syndesc *as; {
printf("bos: can't find address for host '%s'\n", hostname);
exit(1);
}
bcopy(th->h_addr, &addr, sizeof(afs_int32));
memcpy(&addr, th->h_addr, sizeof(afs_int32));
/* get tokens for making authenticated connections */
localauth = (as->parms[ADDPARMOFFSET + 2].items != 0);
@ -289,7 +289,7 @@ afs_int32 alen; {
register char *tp;
strcpy(aresult, adir);
tp = rindex(aname, '/');
tp = strrchr(aname, '/');
if (!tp) {
/* no '/' in name */
strcat(aresult, "/");
@ -785,7 +785,7 @@ register struct cmd_syndesc *as; {
char buf[BUFSIZ], ver[BUFSIZ];
tconn = GetConn(as, 1);
bzero(&tkey, sizeof(struct ktc_encryptionKey));
memset(&tkey, 0, sizeof(struct ktc_encryptionKey));
if(as->parms[1].items)
strcpy(buf,as->parms[1].items->data);
@ -1350,7 +1350,7 @@ struct cmd_syndesc *as; {
char *orphans;
char *tp;
bzero(&mrafsParm, sizeof(mrafsParm));
memset(&mrafsParm, 0, sizeof(mrafsParm));
/* parm 0 is machine name, 1 is partition, 2 is volume, 3 is -all flag */
tconn = GetConn(as, 0);

View File

@ -60,11 +60,11 @@ struct ktime *aktime; {
code = 0; /* assume success */
switch (atype) {
case 1:
bcopy(&bozo_nextRestartKT, aktime, sizeof(struct ktime));
memcpy(aktime, &bozo_nextRestartKT, sizeof(struct ktime));
break;
case 2:
bcopy(&bozo_nextDayKT, aktime, sizeof(struct ktime));
memcpy(aktime, &bozo_nextDayKT, sizeof(struct ktime));
break;
default:
@ -92,11 +92,11 @@ struct ktime *aktime; {
code = 0; /* assume success */
switch (atype) {
case 1:
bcopy(aktime, &bozo_nextRestartKT, sizeof(struct ktime));
memcpy(&bozo_nextRestartKT, aktime, sizeof(struct ktime));
break;
case 2:
bcopy(aktime, &bozo_nextDayKT, sizeof(struct ktime));
memcpy(&bozo_nextDayKT, aktime, sizeof(struct ktime));
break;
default:
@ -472,8 +472,8 @@ char *aname; {
goto fail;
}
bzero(&tcell.hostAddr[which], sizeof(struct sockaddr_in));
bzero(tcell.hostName[which], MAXHOSTCHARS);
memset(&tcell.hostAddr[which], 0, sizeof(struct sockaddr_in));
memset(tcell.hostName[which], 0, MAXHOSTCHARS);
code = afsconf_SetCellInfo(bozo_confdir, AFSDIR_SERVER_ETC_DIRPATH, &tcell);
fail:
@ -534,7 +534,7 @@ char *aname; {
}
}
bzero(&tcell.hostAddr[which], sizeof(struct sockaddr_in));
memset(&tcell.hostAddr[which], 0, sizeof(struct sockaddr_in));
strcpy(tcell.hostName[which], aname);
code = afsconf_SetCellInfo(bozo_confdir, AFSDIR_SERVER_ETC_DIRPATH, &tcell);
@ -572,7 +572,7 @@ struct bozo_key *akey;
goto fail;
}
*akvno = tkeys.key[an].kvno;
bzero(akeyinfo, sizeof(struct bozo_keyInfo));
memset(akeyinfo, 0, sizeof(struct bozo_keyInfo));
noauth = afsconf_GetNoAuthFlag(bozo_confdir);
rxkad_GetServerInfo(acall->conn, &enc_level, 0, 0, 0, 0, 0);
@ -581,9 +581,9 @@ struct bozo_key *akey;
*/
if ((noauth) || (enc_level == rxkad_crypt)) {
bcopy(tkeys.key[an].key, akey, 8);
memcpy(akey, tkeys.key[an].key, 8);
}
else bzero (akey, 8);
else memset(akey, 0, 8);
code = stat(AFSDIR_SERVER_KEY_FILEPATH, &tstat);
if (code == 0) {
@ -1281,7 +1281,7 @@ BOZO_GetInstanceInfo(acall, ainstance, atype, astatus)
strcpy(*atype, tb->type->name);
else
(*atype)[0] = 0; /* null string */
bzero(astatus, sizeof(struct bozo_status)); /* good defaults */
memset(astatus, 0, sizeof(struct bozo_status)); /* good defaults */
astatus->goal = tb->goal;
astatus->fileGoal = tb->fileGoal;
astatus->procStartTime = tb->procStartTime;
@ -1316,7 +1316,7 @@ char **aparm; {
bnode_Hold(tb);
if (anum == 999) {
if (tb->notifier) {
bcopy(tb->notifier, tp, strlen(tb->notifier)+1);
memcpy(tp, tb->notifier, strlen(tb->notifier)+1);
code = 0;
} else
code = BZNOENT; /* XXXXX */

View File

@ -866,7 +866,7 @@ char **envp;
bozo_Log("try the 'hostname' command\n");
exit(1);
}
bzero(tcell.hostAddr, sizeof(tcell.hostAddr)); /* not computed */
memset(tcell.hostAddr, 0, sizeof(tcell.hostAddr)); /* not computed */
code = afsconf_SetCellInfo(bozo_confdir, AFSDIR_SERVER_ETC_DIRPATH, &tcell);
if (code) {
bozo_Log("could not create cell database in '%s' (code %d), quitting\n", AFSDIR_SERVER_ETC_DIRPATH, code);

View File

@ -151,7 +151,7 @@ char *acommand; {
}
te = (struct cronbnode *) malloc(sizeof(struct cronbnode));
bzero(te, sizeof(struct cronbnode));
memset(te, 0, sizeof(struct cronbnode));
code = ktime_ParsePeriodic(awhen, &te->whenToRun);
if (code < 0) {
free(te);

View File

@ -91,7 +91,7 @@ char *acommand; {
}
te = (struct ezbnode *) malloc(sizeof(struct ezbnode));
bzero(te, sizeof(struct ezbnode));
memset(te, 0, sizeof(struct ezbnode));
bnode_InitBnode(te, &ezbnode_ops, ainstance);
te->command = cmdpath;
return (struct bnode *) te;

View File

@ -342,7 +342,7 @@ char *ascancmd; {
}
te = (struct fsbnode *) malloc(sizeof(struct fsbnode));
bzero(te, sizeof(struct fsbnode));
memset(te, 0, sizeof(struct fsbnode));
te->filecmd = fileCmdpath;
te->volcmd = volCmdpath;
te->salcmd = salCmdpath;

View File

@ -58,7 +58,7 @@ main(argc, argv)
struct sigaction intaction, oldaction;
struct cmd_syndesc *cptr;
bzero((char *)&intaction, sizeof(intaction));
memset((char *)&intaction, 0, sizeof(intaction));
intaction.sa_handler = (int (*)())quitFms;
sigaction(SIGINT, &intaction, &oldaction);
@ -280,7 +280,7 @@ dataBlock(usd_handle_t hTape, afs_int32 reqSize)
if ( dB_buffer == 0 )
ERROR(-1);
dB_buffersize = reqSize;
bzero(dB_buffer, dB_buffersize);
memset(dB_buffer, 0, dB_buffersize);
}
ptr = (int *) dB_buffer;

View File

@ -125,7 +125,7 @@ afs_int32 getSPEntries(server, partition, serverlist, ss, ps)
*ss = 0;
return(BC_NOMEM);
}
bzero(*ss, sizeof(struct serversort));
memset(*ss, 0, sizeof(struct serversort));
(*ss)->ipaddr = server;
(*ss)->next = *serverlist;
*serverlist = *ss;
@ -148,7 +148,7 @@ afs_int32 getSPEntries(server, partition, serverlist, ss, ps)
*ss = 0;
return(BC_NOMEM);
}
bzero(*ps, sizeof(struct partitionsort));
memset(*ps, 0, sizeof(struct partitionsort));
(*ps)->part = partition;
(*ps)->next = (*ss)->partitions;
(*ss)->partitions = *ps;
@ -305,7 +305,7 @@ int EvalVolumeSet2(aconfig, avs, avols, uclient)
com_err(whoami, BC_NOMEM, "");
ERROR(BC_NOMEM);
}
bzero(tvd, sizeof(*tvd));
memset(tvd, 0, sizeof(*tvd));
tvd->name = (char *) malloc(strlen(entries[e].name)+10);
if (!(tvd->name)) {
@ -428,7 +428,7 @@ int EvalVolumeSet1(aconfig, avs, avols, uclient)
*/
for (index=0; 1; index=next_index)
{ /*w*/
bzero(&entry, sizeof(entry));
memset(&entry, 0, sizeof(entry));
code = ubik_Call(VL_ListEntry, /*Routine to invoke*/
uclient, /*Ubik client structure*/
0, /*Ubik flags*/
@ -551,7 +551,7 @@ int EvalVolumeSet1(aconfig, avs, avols, uclient)
com_err(whoami, BC_NOMEM,"");
return(BC_NOMEM);
}
bzero(tvd, sizeof(*tvd));
memset(tvd, 0, sizeof(*tvd));
tvd->name = (char *) malloc(strlen(entry.name)+10);
if (!(tvd->name))
@ -1044,7 +1044,7 @@ bc_KillCmd(as, arock)
tp = as->parms[0].items->data;
if (index(tp, '.') == 0)
if (strchr(tp, '.') == 0)
{
slot = bc_SafeATOI(tp);
if (slot == -1)
@ -1181,7 +1181,7 @@ bc_VolRestoreCmd(as, arock)
com_err(whoami,BC_NOMEM,"");
return BC_NOMEM;
}
bzero(tvol, sizeof(struct bc_volumeDump));
memset(tvol, 0, sizeof(struct bc_volumeDump));
tvol->name = (char *) malloc(VOLSER_MAXVOLNAME +1);
if (!tvol->name)
@ -1301,8 +1301,8 @@ char *arock; {
}
/* create a volume set corresponding to the volume pattern we've been given */
bzero(&tvolumeSet, sizeof(tvolumeSet));
bzero(&tvolumeEntry, sizeof(tvolumeEntry));
memset(&tvolumeSet, 0, sizeof(tvolumeSet));
memset(&tvolumeEntry, 0, sizeof(tvolumeEntry));
tvolumeSet.name = "TempVolumeSet";
tvolumeSet.ventries = &tvolumeEntry;
tvolumeEntry.serverName = as->parms[0].items->data;
@ -1331,7 +1331,7 @@ char *arock; {
}
}
else /* use destination host == original host */
bcopy(&tvolumeEntry.server, &destServ, sizeof(destServ));
memcpy(&destServ, &tvolumeEntry.server, sizeof(destServ));
/* specified other destination partition */
if (as->parms[9].items)
@ -1515,7 +1515,7 @@ bc_VolsetRestoreCmd (as, arock)
/* Allocate a volumeDump structure and link it in */
tvol = (struct bc_volumeDump *) malloc(sizeof(struct bc_volumeDump));
bzero(tvol, sizeof(struct bc_volumeDump));
memset(tvol, 0, sizeof(struct bc_volumeDump));
tvol->name = (char *) malloc(VOLSER_MAXVOLNAME+1);
if (!tvol->name)
@ -1524,7 +1524,7 @@ bc_VolsetRestoreCmd (as, arock)
return BC_NOMEM;
}
strncpy(tvol->name, volume, VOLSER_OLDMAXVOLNAME);
bcopy(&destServer, &tvol->server, sizeof(destServer));
memcpy(&tvol->server, &destServer, sizeof(destServer));
tvol->partition = destPartition;
if (lastVol) lastVol->next = tvol; /* thread onto end of list */
@ -1904,7 +1904,7 @@ int bc_DumpCmd(as, arock)
if (parent) problemFindingDump = 1;
parent = dumpEntry.id;
level = dumpEntry.level+1;
bcopy(&dumpEntry, &fde, sizeof(dumpEntry));
memcpy(&fde, &dumpEntry, sizeof(dumpEntry));
}
else {
/* Dump hierarchy not complete so can't base off the latest */
@ -2763,7 +2763,7 @@ DBLookupByVolume(volumeName)
tempPtr = (struct dumpedVol *) malloc(sizeof(struct dumpedVol));
if (!tempPtr) ERROR(BC_NOMEM);
bzero(tempPtr, sizeof(*tempPtr));
memset(tempPtr, 0, sizeof(*tempPtr));
tempPtr->incTime = volumeEntry[i].clone;
tempPtr->dumpID = volumeEntry[i].dump;
strncpy(tempPtr->tapeName, volumeEntry[i].tape, BU_MAXTAPELEN);
@ -2925,7 +2925,7 @@ dumpInfo(dumpid, detailFlag)
ERROR(BC_NOMEM);
}
bzero(tapeLinkPtr, sizeof(*tapeLinkPtr));
memset(tapeLinkPtr, 0, sizeof(*tapeLinkPtr));
code = bcdb_FindTapeSeq(dumpid, tapeNumber, &tapeLinkPtr->tapeEntry);
if (code)
{
@ -2987,10 +2987,9 @@ dumpInfo(dumpid, detailFlag)
com_err(whoami,BC_NOMEM,"");
ERROR(BC_NOMEM);
}
bzero(volumeLinkPtr, sizeof(*volumeLinkPtr));
memset(volumeLinkPtr, 0, sizeof(*volumeLinkPtr));
bcopy(&vl.budb_volumeList_val[i], &volumeLinkPtr->volumeEntry,
sizeof(struct budb_volumeEntry));
memcpy(&volumeLinkPtr->volumeEntry, &vl.budb_volumeList_val[i], sizeof(struct budb_volumeEntry));
/* now insert it onto the right place */
while ( (*link != 0) &&

View File

@ -72,7 +72,7 @@ bc_InitConfig(apath)
if (!tb) return(BC_NOMEM);
bc_globalConfig = tb;
bzero(tb, sizeof(struct bc_config));
memset(tb, 0, sizeof(struct bc_config));
tb->path = (char *) malloc(strlen(apath)+1);
if (!tb->path)
{
@ -108,13 +108,13 @@ char *aname; {
/* tlast now points to the next pointer (or head pointer) we should overwrite */
tentry = (struct bc_hostEntry *) malloc(sizeof(struct bc_hostEntry));
bzero(tentry, sizeof(*tentry));
memset(tentry, 0, sizeof(*tentry));
tentry->name = (char *) malloc(strlen(aname)+1);
strcpy(tentry->name, aname);
*tlast = tentry;
tentry->next = (struct bc_hostEntry *) 0;
tentry->addr.sin_family = AF_INET;
bcopy(th->h_addr, &tentry->addr.sin_addr.s_addr, sizeof(afs_int32));
memcpy(&tentry->addr.sin_addr.s_addr, th->h_addr, sizeof(afs_int32));
tentry->addr.sin_port = 0;
tentry->portOffset = aport;
return 0;

View File

@ -177,7 +177,7 @@ tailCompPtr(pathNamePtr)
char *pathNamePtr;
{
char *ptr;
ptr = rindex(pathNamePtr, '/');
ptr = strrchr(pathNamePtr, '/');
if ( ptr == 0 )
{
/* this should never happen */

View File

@ -154,9 +154,9 @@ int bc_ParseHost(aname, asockaddr)
asockaddr->sin_family = AF_INET;
asockaddr->sin_port = 0;
addr = (b1<<24) | (b2<<16) | (b3<<8) | b4;
bcopy(&addr,&tmp1,sizeof(afs_int32));
memcpy(&tmp1, &addr, sizeof(afs_int32));
tmp2 = htonl(tmp1);
bcopy(&tmp2, &asockaddr->sin_addr.s_addr, sizeof(afs_int32));
memcpy(&asockaddr->sin_addr.s_addr, &tmp2, sizeof(afs_int32));
return(0);
}
@ -166,7 +166,7 @@ int bc_ParseHost(aname, asockaddr)
*/
if (strcmp(aname, ".*") == 0) {
bzero(asockaddr, sizeof(struct sockaddr_in));
memset(asockaddr, 0, sizeof(struct sockaddr_in));
return 0;
}
@ -182,10 +182,9 @@ int bc_ParseHost(aname, asockaddr)
*/
asockaddr->sin_family = AF_INET;
asockaddr->sin_port = 0;
bcopy(th->h_addr,&tmp1,sizeof(afs_int32));
memcpy(&tmp1, th->h_addr, sizeof(afs_int32));
tmp2 = htonl(tmp1);
bcopy(&tmp2,&(asockaddr->sin_addr.s_addr),
sizeof(asockaddr->sin_addr.s_addr));
memcpy(&(asockaddr->sin_addr.s_addr), &tmp2, sizeof(asockaddr->sin_addr.s_addr));
return(0);
} /*bc_ParseHost*/
@ -203,7 +202,7 @@ bc_CreateVolumeSet(aconfig, avolName, aflags)
/* move to end of the list */
nset = (struct bc_volumeSet *) malloc(sizeof(struct bc_volumeSet));
bzero(nset, sizeof(*nset));
memset(nset, 0, sizeof(*nset));
nset->flags = aflags;
nset->name = (char *) malloc(strlen(avolName)+1);
strcpy(nset->name, avolName);
@ -314,7 +313,7 @@ bc_AddVolumeItem(aconfig, avolName, ahost, apart, avol)
/* move to end of the list */
for(tentry = *tlast; tentry; tlast = &tentry->next, tentry = *tlast);
tentry = (struct bc_volumeEntry *) malloc(sizeof(struct bc_volumeEntry));
bzero(tentry, sizeof(*tentry));
memset(tentry, 0, sizeof(*tentry));
tentry->serverName = (char *) malloc(strlen(ahost)+1);
strcpy(tentry->serverName, ahost);
tentry->partname = (char *) malloc(strlen(apart)+1);
@ -381,7 +380,7 @@ afs_int32 expType;
return -2; /* name specification error */
tdump = (struct bc_dumpSchedule *) malloc(sizeof(struct bc_dumpSchedule));
bzero(tdump, sizeof(*tdump));
memset(tdump, 0, sizeof(*tdump));
/* prepend this node to the dump schedule list */
tdump->next = aconfig->dsched;
@ -568,7 +567,7 @@ FindDump(aconfig, nodeString, parentptr, nodeptr)
matchLength = 0;
curptr = &nodeString[1]; /* past first / */
separator = index(curptr, '/');
separator = strchr(curptr, '/');
if ( separator == 0 )
matchLength = strlen(curptr) + 1; /* +1 for leading / */
else
@ -613,7 +612,7 @@ FindDump(aconfig, nodeString, parentptr, nodeptr)
return(-3);
}
separator = index(curptr, '/');
separator = strchr(curptr, '/');
if ( separator == 0 )
matchLength = strlen(&nodeString[0]);
else

View File

@ -120,7 +120,7 @@ bc_Dumper(aindex)
baseNamePtr = tailCompPtr(dumpTaskPtr->dumpName);
/* setup the interface structure */
bzero(tcdiPtr, sizeof(*tcdiPtr));
memset(tcdiPtr, 0, sizeof(*tcdiPtr));
/* general */
strcpy(tcdiPtr->dumpPath, dumpTaskPtr->dumpName);
@ -273,7 +273,7 @@ bc_StartDmpRst(aconfig, adname, avname, avolsToDump, adestServer, adestPartition
return(BC_NOTLOCKED);
}
bzero(&bc_dumpTasks[i], sizeof(struct bc_dumpTask));
memset(&bc_dumpTasks[i], 0, sizeof(struct bc_dumpTask));
bc_dumpTasks[i].callProc = aproc;
bc_dumpTasks[i].config = aconfig;
bc_dumpTasks[i].volumes = avolsToDump;
@ -298,9 +298,9 @@ bc_StartDmpRst(aconfig, adname, avname, avolsToDump, adestServer, adestPartition
bc_dumpTasks[i].expType = dsptr->expType;
}
if (adestServer)
bcopy(adestServer, &bc_dumpTasks[i].destServer, sizeof(struct sockaddr_in));
memcpy(&bc_dumpTasks[i].destServer, adestServer, sizeof(struct sockaddr_in));
else
bzero(&bc_dumpTasks[i].destServer, sizeof(struct sockaddr_in));
memset(&bc_dumpTasks[i].destServer, 0, sizeof(struct sockaddr_in));
code = LWP_CreateProcess(bc_DmpRstStart, 20480, LWP_NORMAL_PRIORITY, i, "helper", &junk);
if (code)
@ -373,7 +373,7 @@ afs_int32 size;
code = ConnectButc(config, port, &tconn);
if (code) return(code);
bzero(&label,sizeof(label));
memset(&label, 0, sizeof(label));
if (afsname)
strcpy(label.afsname, afsname);
if (pname)
@ -421,7 +421,7 @@ bc_ReadLabel(config,port)
code = ConnectButc(config, port, &tconn);
if (code) return(code);
bzero(&label,sizeof(label));
memset(&label, 0, sizeof(label));
code = TC_ReadLabel(tconn, &label, &taskId);
if (code) {
if (code == BUTM_NOLABEL) {

View File

@ -394,7 +394,7 @@ bc_ParseDumpSchedule()
return (BC_INTERNALERROR);
}
tds = (struct bc_dumpSchedule *)malloc(sizeof(struct bc_dumpSchedule));
bzero(tds, sizeof(*tds));
memset(tds, 0, sizeof(*tds));
tds->next = (struct bc_dumpSchedule *) 0;
tds->name = (char *) malloc(strlen(dsname)+1);

View File

@ -63,7 +63,7 @@ LongTo_ktimeRelDate(longDate, kdptr)
afs_int32 longDate;
struct ktime_date *kdptr;
{
bzero(kdptr, sizeof(*kdptr));
memset(kdptr, 0, sizeof(*kdptr));
kdptr->day = longDate % (MAX_DAY_VALUE + 1);
if ( kdptr->day != 0 )
@ -264,7 +264,7 @@ ParseRelDate(dateStr, relDatePtr)
afs_int32 value, digit_limit;
afs_int32 type_index;
bzero(relDatePtr, sizeof(*relDatePtr));
memset(relDatePtr, 0, sizeof(*relDatePtr));
type_index = 0;
while ( 1 )

View File

@ -195,7 +195,7 @@ bc_InitTextConfig()
for ( i = 0; i < TB_NUM; i++ )
{
bzero(ctPtr, sizeof(*ctPtr));
memset(ctPtr, 0, sizeof(*ctPtr));
ctPtr->textType = i;
ctPtr->textVersion = -1;
ctPtr++;

View File

@ -44,10 +44,6 @@ extern void bc_HandleMisc();
extern char *whoami;
extern struct rx_connection *bc_GetConn();
#ifdef AFS_SGI64_ENV
extern char *rindex();
#endif
#define BC_MAXLEVELS 20
#define MAXTAPESATONCE 10
@ -139,7 +135,7 @@ extractTapeSeq(tapename)
{
char *sptr;
sptr = rindex(tapename, '.');
sptr = strrchr(tapename, '.');
if ( !sptr ) return(-1);
sptr++;
return(atol(sptr));
@ -277,7 +273,7 @@ bc_Restorer(aindex)
com_err(whoami,BC_NOMEM,"");
ERROR(BC_NOMEM);
}
bzero (di, sizeof(struct dumpinfo));
memset(di, 0, sizeof(struct dumpinfo));
di->DumpId = dumpDescr->id;
di->initialDumpId = dumpDescr->initialDumpID;
@ -303,7 +299,7 @@ bc_Restorer(aindex)
com_err(whoami,BC_NOMEM,"");
ERROR(BC_NOMEM);
}
bzero (vi, sizeof(struct volinfo));
memset(vi, 0, sizeof(struct volinfo));
vi->volname = (char*)malloc(strlen(vname)+1);
if (!vi->volname)
@ -337,7 +333,7 @@ bc_Restorer(aindex)
for (di=dumpinfolist; di; di=di->next)
{
/* Find each of the parent dumps */
bcopy(di, &dlevels[0], sizeof(struct dumpinfo));
memcpy(&dlevels[0], di, sizeof(struct dumpinfo));
for (lvl=1, parent=dlevels[0].parentDumpId; parent;
parent=dlevels[lvl].parentDumpId, lvl++)
{
@ -479,7 +475,7 @@ bc_Restorer(aindex)
com_err(whoami,BC_NOMEM,"");
return(BC_NOMEM);
}
bzero(tle, sizeof(struct bc_tapeList));
memset(tle, 0, sizeof(struct bc_tapeList));
tle->tapeName = (char*)malloc(strlen(volumeEntries[ve].tape)+1);
if (!tle->tapeName)
@ -531,7 +527,7 @@ bc_Restorer(aindex)
com_err(whoami,BC_NOMEM,"");
return(BC_NOMEM);
}
bzero(ti, sizeof(struct bc_tapeItem));
memset(ti, 0, sizeof(struct bc_tapeItem));
ti->volumeName = (char*)malloc(strlen(volumeEntries[ve].name)+1);
if (!ti->volumeName)
@ -630,7 +626,7 @@ bc_Restorer(aindex)
com_err(whoami,BC_NOMEM,"");
ERROR(BC_NOMEM);
}
bzero(tcarray, nentries*sizeof(struct tc_restoreDesc));
memset(tcarray, 0, nentries*sizeof(struct tc_restoreDesc));
/* Fill in the array with the list above */
i = 0;

View File

@ -100,7 +100,7 @@ createStatusNode()
{
return(0);
}
bzero(ptr, sizeof(*ptr));
memset(ptr, 0, sizeof(*ptr));
/* link it onto the chain of status entries */
ObtainWriteLock(&statusQueueLock);

View File

@ -269,7 +269,7 @@ int bc_ParseHosts()
the = (struct bc_hostEntry *) malloc(sizeof(struct bc_hostEntry));
if (the == (struct bc_hostEntry *)0)
return (BC_NOMEM);
bzero(the, sizeof(struct bc_hostEntry));
memset(the, 0, sizeof(struct bc_hostEntry));
if (tlast)
{
tlast->next = the;
@ -284,7 +284,7 @@ int bc_ParseHosts()
strcpy(the->name, hostName);
the->portOffset = port;
if (th) {
bcopy(th->h_addr, &the->addr.sin_addr.s_addr, 4);
memcpy(&the->addr.sin_addr.s_addr, th->h_addr, 4);
the->addr.sin_family = AF_INET;
the->addr.sin_port = 0;
}

View File

@ -87,7 +87,7 @@ afs_int32 *adumpID; {
printf("tape controller received request to start dump %s.\n", adumpName);
*adumpID = ++transID; /* send result back to caller */
bzero(&tdentry, sizeof(tdentry));
memset(&tdentry, 0, sizeof(tdentry));
tdentry.created = time(0);
strcpy(tdentry.name, atapeSet->format);
strcat(tdentry.name, ".");
@ -111,7 +111,7 @@ afs_int32 *adumpID; {
printf("created dump %d\n", tdentry.id);
/* start tape (preent all fits on one tape at first */
bzero(&ttentry, sizeof(ttentry));
memset(&ttentry, 0, sizeof(ttentry));
sprintf(ttentry.name, tdentry.tapes.format, 1);
ttentry.written = time(0);
ttentry.dump = tdentry.id; /* dump we're in */
@ -126,10 +126,10 @@ afs_int32 *adumpID; {
tdescr = adumpArray->tc_dumpArray_val;
for(i=0;i<adumpArray->tc_dumpArray_len;i++, tdescr++) {
bcopy(tdescr->hostID, &taddr, sizeof(taddr));
memcpy(&taddr, tdescr->hostID, sizeof(taddr));
printf("dumping volid %s(%d) from host %08x since date %d\n", tdescr->name,
tdescr->vid, taddr.sin_addr.s_addr, tdescr->date);
bzero(&tventry, sizeof(tventry));
memset(&tventry, 0, sizeof(tventry));
strcpy(tventry.name, tdescr->name);
tventry.clone = tdescr->date;
tventry.seq = 0; /* frag in volume */
@ -174,7 +174,7 @@ afs_int32 *adumpID; {
printf("tape controller received request to start restore %s.\n", aname);
tdescr = arestore->tc_restoreArray_val;
for(i=0;i<arestore->tc_restoreArray_len; i++, tdescr++) {
bcopy(tdescr->hostID, &taddr, sizeof(taddr));
memcpy(&taddr, tdescr->hostID, sizeof(taddr));
printf("restoring frag %d of volume %s from tape %s at position %d.\n New name is '%s', new vid is %d, new host is %08x, new partition is %d\n",
tdescr->frag, tdescr->oldName, tdescr->tapeName, tdescr->position, tdescr->newName,
tdescr->vid, taddr.sin_addr.s_addr, tdescr->partition);

View File

@ -234,7 +234,7 @@ bcdb_FindDumpByID(dumpID, deptr)
goto error;
}
bcopy(dl.budb_dumpList_val, deptr, sizeof(*deptr));
memcpy(deptr, dl.budb_dumpList_val, sizeof(*deptr));
exit:
if ( dl.budb_dumpList_val )
@ -245,7 +245,7 @@ exit:
return(code);
error:
bzero(deptr, sizeof(*deptr));
memset(deptr, 0, sizeof(*deptr));
goto exit;
}
@ -327,7 +327,7 @@ bcdb_FindTape(dumpid, tapeName, teptr)
afs_int32 dbTime;
afs_int32 code = 0;
bzero(teptr, sizeof(*teptr));
memset(teptr, 0, sizeof(*teptr));
tl.budb_tapeList_len = 0;
tl.budb_tapeList_val = 0;
@ -341,7 +341,7 @@ bcdb_FindTape(dumpid, tapeName, teptr)
if (tl.budb_tapeList_len != 1)
ERROR(BC_NOTUNIQUE); /* expecting a single descriptor */
bcopy(tl.budb_tapeList_val, teptr, sizeof(*teptr));
memcpy(teptr, tl.budb_tapeList_val, sizeof(*teptr));
error_exit:
if ( tl.budb_tapeList_val )
@ -359,7 +359,7 @@ bcdb_FindTapeSeq(dumpid, tapeSeq, teptr)
afs_int32 dbTime;
afs_int32 code = 0;
bzero(teptr, sizeof(*teptr));
memset(teptr, 0, sizeof(*teptr));
tl.budb_tapeList_len = 0;
tl.budb_tapeList_val = 0;
@ -372,7 +372,7 @@ bcdb_FindTapeSeq(dumpid, tapeSeq, teptr)
if (tl.budb_tapeList_len != 1)
ERROR(BC_NOTUNIQUE); /* expecting a single descriptor */
bcopy(tl.budb_tapeList_val, teptr, sizeof(*teptr));
memcpy(teptr, tl.budb_tapeList_val, sizeof(*teptr));
error_exit:
if ( tl.budb_tapeList_val )
@ -1191,14 +1191,14 @@ ubik_Call_SingleServer(aproc, aclient, aflags, p1, p2, p3, p4, p5, p6, p7, p8, p
if ( code )
{
/* error. Clean up single server state */
bzero(&uServer, sizeof(uServer));
memset(&uServer, 0, sizeof(uServer));
}
return(code);
}
else
if ( (aflags & UF_END_SINGLESERVER) != 0 )
{
bzero(&uServer, sizeof(uServer));
memset(&uServer, 0, sizeof(uServer));
return(0);
}
}

View File

@ -496,7 +496,7 @@ bc_ParseVolumeSet()
* global configuration structure.
*/
tvs = (struct bc_volumeSet *) malloc(sizeof(struct bc_volumeSet));
bzero(tvs, sizeof(*tvs));
memset(tvs, 0, sizeof(*tvs));
tvs->name = (char *) malloc(strlen(vsname)+1);
strcpy(tvs->name, vsname);
@ -531,7 +531,7 @@ bc_ParseVolumeSet()
com_err(whoami,0, "Can't malloc() a new volume spec record!");
return(-1);
}
bzero(tve, sizeof(*tve));
memset(tve, 0, sizeof(*tve));
if (bc_ParseHost(serverName, &(tve->server)))
com_err(whoami,0, "Can't get required info on host '%s'", serverName);

View File

@ -44,7 +44,7 @@ afs_int32 InitDB ()
pollCount = 0;
bzero (&db, sizeof(db));
memset(&db, 0, sizeof(db));
Lock_Init (&db.lock);
if ((code = InitDBalloc ()) || (code = InitDBhash ()))
return code;
@ -225,7 +225,7 @@ CheckInit (ut, db_init)
LogDebug(0, "No data base - Building new one\n");
/* try to write a good header */
bzero(&db.h,sizeof(db.h));
memset(&db.h, 0, sizeof(db.h));
db.h.version = htonl(BUDB_VERSION);
db.h.checkVersion = htonl(BUDB_VERSION);
db.h.lastUpdate = db.h.lastDumpId = htonl(time(0));

View File

@ -84,7 +84,7 @@ AllocBlock (ut, block, aP)
}
/* clear and return the block */
bzero (block, sizeof(*block));
memset(block, 0, sizeof(*block));
*aP = a;
return 0;
}
@ -103,7 +103,7 @@ FreeBlock (ut, bh, a)
dbadr a; /* db address of block */
{
if (a != BlockBase(a)) db_panic ("Block addr no good");
bzero (bh, sizeof(*bh));
memset(bh, 0, sizeof(*bh));
bh->next = db.h.freePtrs[0];
if (set_header_word (ut, freePtrs[0], htonl(a)) ||
dbwrite (ut, a, (char *)bh, sizeof(*bh))) return BUDB_IO;

View File

@ -620,7 +620,7 @@ writeDatabase(ut, fid)
/* Read the dump entry */
if (dbAddr == dbAppAddr) {
/* First time through, don't need to read the dump entry again */
bcopy(&diskDump, &apDiskDump, sizeof(diskDump));
memcpy(&apDiskDump, &diskDump, sizeof(diskDump));
}
else {
if (badEntry(dbAppAddr)) {

View File

@ -159,7 +159,7 @@ afs_int32 ht_AllocTable (ut, mht)
mht->size = nb*sizeof(struct memoryHTBlock *);
b = mht->blocks = (struct memoryHTBlock **)malloc (mht->size);
bzero (b, mht->size);
memset(b, 0, mht->size);
for (i=0; i<nb; i++) {
b[i] = (struct memoryHTBlock *)malloc (sizeof (struct memoryHTBlock));
@ -265,7 +265,7 @@ ht_GetTableBlock (ut, mht, hash, old, blockP, boP)
if (*blocksP == 0) {
*sizeP = ht_TableSize (length);
*blocksP = (struct memoryHTBlock **)malloc (*sizeP);
bzero (*blocksP, *sizeP);
memset(*blocksP, 0, *sizeP);
}
n = *sizeP / sizeof (struct memoryHTBlock *);
if (bi >= n) db_panic ("table size inconsistent");

View File

@ -172,7 +172,7 @@ afs_int32 GetText (call, lockHandle, textType, maxLength, offset,
textRemaining = BLOCK_DATA_SIZE - blockOffset;
chunkSize = min(textRemaining, transferSize);
bcopy(&block.a[blockOffset], textPtr, chunkSize);
memcpy(textPtr, &block.a[blockOffset], chunkSize);
/* LogDebug(5, "transfering %d bytes: %s\n", chunkSize, textPtr); */
@ -400,7 +400,7 @@ afs_int32 SaveText (call, lockHandle, textType, offset, flags, charListPtr)
chunkSize = MIN(remainingInBlock, textLength);
/* copy in the data */
bcopy(textptr, &diskBlock.a[offset % BLOCK_DATA_SIZE], chunkSize);
memcpy(&diskBlock.a[offset % BLOCK_DATA_SIZE], textptr, chunkSize);
/* LogDebug(5, "text is %s\n", textptr); */

View File

@ -143,7 +143,7 @@ afs_int32 DumpDB (call, firstcall, maxLength, charListPtr, done)
LogDebug(5, "Setup dump\n");
/* no dump in progress - setup and retake lock */
bzero(dumpSyncPtr, sizeof(*dumpSyncPtr));
memset(dumpSyncPtr, 0, sizeof(*dumpSyncPtr));
/* ObtainWriteLock(&dumpSyncPtr->ds_lock); */
/* mark dump in progress */
@ -320,7 +320,7 @@ dumpWatcher()
if (code) LogError(code, "Aborting dump transaction\n");
}
bzero(dumpSyncPtr, sizeof(*dumpSyncPtr));
memset(dumpSyncPtr, 0, sizeof(*dumpSyncPtr));
goto exit;
} /*i*/

View File

@ -723,12 +723,12 @@ verifyBlocks(ut)
bmsize = sizeof(*ablockMap) + (blockEntries[blocktype]-1) * sizeof(ablockMap->entries[0]);
ablockMap = (struct blockMap *) malloc(bmsize);
if (!ablockMap) ERROR(BUDB_NOMEM);
bzero(ablockMap, bmsize);
memset(ablockMap, 0, bmsize);
ablockMap->nEntries = blockEntries[blocktype];
/* save the block header in the block map */
bcopy(&block.h, &ablockMap->header, sizeof(ablockMap->header));
memcpy(&ablockMap->header, &block.h, sizeof(ablockMap->header));
blockMap[i] = ablockMap;
}
@ -1276,7 +1276,7 @@ verifyDatabase(ut, recreateFile)
/* clear verification statistics */
misc = &miscData;
bzero (&miscData, sizeof(miscData));
memset(&miscData, 0, sizeof(miscData));
#ifdef PDEBUG
miscData.maxErrors = 1000000;
@ -1309,7 +1309,7 @@ verifyDatabase(ut, recreateFile)
bmsize = nBlocks*sizeof(struct blockMap *);
blockMap = (struct blockMap **) malloc(bmsize);
if (!blockMap) ERROR(BUDB_NOMEM);
bzero(blockMap, bmsize);
memset(blockMap, 0, bmsize);
/* verify blocks and construct the block map */
Log("Read header of every block\n");
@ -1462,7 +1462,7 @@ error_exit:
if (!th) *host = 0;
else
{
bcopy(th->h_addr, host, sizeof(afs_int32));
memcpy(host, th->h_addr, sizeof(afs_int32));
*host = ntohl(*host);
}

View File

@ -123,7 +123,7 @@ tailCompPtr(pathNamePtr)
char *pathNamePtr;
{
char *ptr;
ptr = rindex(pathNamePtr, '/');
ptr = strrchr(pathNamePtr, '/');
if ( ptr == 0 )
{
/* this should never happen */
@ -516,7 +516,7 @@ SendReturnList (ut, list, FillProc, e_size, index, nextIndexP, dbTimeP, eList)
eList->budb_dumpList_val = (struct budb_dumpEntry *)malloc (e_size * to_return);
if (!eList->budb_dumpList_val) return(BUDB_NOMEM);
}
bzero(eList->budb_dumpList_val, e_size * to_return);
memset(eList->budb_dumpList_val, 0, e_size * to_return);
eList->budb_dumpList_len = to_return;
e = (char *)(eList->budb_dumpList_val);
@ -707,7 +707,7 @@ static afs_int32 GetVolInfo (ut, volP, viaP, viP)
else if ( !VolInfoMatch(volP,viP) ) /* Not the head volinfo struct */
{
hvia = via; /* remember the head volinfo struct */
bcopy(viP, &hvi, sizeof(hvi));
memcpy(&hvi, viP, sizeof(hvi));
/* Search the same name chain for the correct volinfo structure */
for (via=ntohl(viP->sameNameChain); via; via=ntohl(viP->sameNameChain))
@ -998,7 +998,7 @@ rememberDump(dumpAddrParam, dumpParam, dumpListPtrParam)
ptr = (struct chosenDump *) malloc(sizeof(*ptr));
if (!ptr)
return(0);
bzero(ptr, sizeof(*ptr));
memset(ptr, 0, sizeof(*ptr));
ptr->addr = dumpAddr;
ptr->date = (afs_uint32) ntohl(dumpPtr->created);
@ -1385,7 +1385,7 @@ afs_int32 CreateDump(call, dump)
}
/* Allocate a dump structure */
bzero (&d, sizeof(d));
memset(&d, 0, sizeof(d));
eval = AllocStructure (ut, dump_BLOCK, 0, &da, &d);
if (eval) ABORT(eval);
@ -2040,7 +2040,7 @@ afs_int32 FindLatestDump (call, vsname, dumpPath, dumpentry)
/* Construct a database dump name */
strcpy(dumpName, DUMP_TAPE_NAME);
}
else if (index(dumpPath,'/') == 0) {
else if (strchr(dumpPath,'/') == 0) {
int level, old, length, hash;
struct dump hostDump, diskDump;
struct memoryHashTable *mht;
@ -2450,7 +2450,7 @@ afs_int32 GetDumps (call, majorVersion, flags, name, start, end,
/* end specifies how many dumps */
if (!end) ABORT(BUDB_BADFLAGS);
bzero(&rock, sizeof(rock));
memset(&rock, 0, sizeof(rock));
rock.maxDumps = end;
scanHashTable(ut, &db.dumpName, wantDump, rememberDump, (char *) &rock);
@ -2737,7 +2737,7 @@ afs_int32 FindLastTape (call, dumpID, dumpEntry, tapeEntry, volEntry)
/* Zero volume entry if the last tape has no volumes */
if (!lastVol) {
bzero(volEntry, sizeof(*volEntry));
memset(volEntry, 0, sizeof(*volEntry));
} else {
/* Follow the volumes until we reach the last volume */
eval = dbread (ut,lastVol,&vf,sizeof(vf));
@ -3138,7 +3138,7 @@ afs_int32 UseTape (call, tape, new)
*new = 0;
bzero (&t, sizeof(t));
memset(&t, 0, sizeof(t));
eval = AllocStructure (ut, tape_BLOCK, 0, &a, &t);
if (eval) ABORT(eval);

View File

@ -94,7 +94,7 @@ convert_cell_to_ubik (cellinfo, myHost, serverList)
printf("prserver: couldn't get address of this host.\n");
BUDB_EXIT(1);
}
bcopy(th->h_addr,myHost,sizeof(afs_int32));
memcpy(myHost, th->h_addr, sizeof(afs_int32));
for (i=0; i<cellinfo->numServers; i++)
/* omit my host from serverList */
@ -351,7 +351,7 @@ main(argc, argv)
exit(2);
}
bzero(globalConfPtr, sizeof(*globalConfPtr));
memset(globalConfPtr, 0, sizeof(*globalConfPtr));
/* set default configuration values */
strcpy(dbDir, AFSDIR_SERVER_DB_DIRPATH);
@ -494,7 +494,7 @@ main(argc, argv)
/* misc. initialization */
/* database dump synchronization */
bzero(dumpSyncPtr, sizeof(*dumpSyncPtr));
memset(dumpSyncPtr, 0, sizeof(*dumpSyncPtr));
Lock_Init(&dumpSyncPtr->ds_lock);
rx_StartServer(0); /* start handling requests */

View File

@ -547,7 +547,7 @@ dumpToBudbDump(dumpPtr, budbDumpPtr)
budbDumpPtr->created = dumpPtr->created;
budbDumpPtr->nVolumes = dumpPtr->nVolumes;
bcopy(&dumpPtr->tapes, &budbDumpPtr->tapes, sizeof(struct budb_tapeSet));
memcpy(&budbDumpPtr->tapes, &dumpPtr->tapes, sizeof(struct budb_tapeSet));
copy_ktcPrincipal_to_budbPrincipal(&dumpPtr->dumper, &budbDumpPtr->dumper);
return(0);
}
@ -611,7 +611,7 @@ default_tapeset(tapesetPtr, dumpname)
struct budb_tapeSet *tapesetPtr;
char *dumpname;
{
bzero(tapesetPtr, sizeof(*tapesetPtr));
memset(tapesetPtr, 0, sizeof(*tapesetPtr));
strcpy(tapesetPtr->format, dumpname);
strcat(tapesetPtr->format, ".%d");

View File

@ -75,7 +75,7 @@ afs_int32 threadEntryDir(anEntry, size, type)
entryPtr->dlq_type = type;
entryPtr->dlq_structPtr = entry;
bcopy (anEntry, entry, size);
memcpy(entry, anEntry, size);
dlqLinkb (&entries_to_flush, entryPtr);
return(0);
}
@ -119,7 +119,7 @@ threadEntry(anEntry, size, type)
entryPtr->dlq_type = type;
entryPtr->dlq_structPtr = entry;
bcopy (anEntry, entry, size);
memcpy(entry, anEntry, size);
dlqLinkb (&savedEntries, (dlqlinkP)entryPtr);
return(0);
}
@ -164,7 +164,7 @@ afs_int32 useTape (aTapeEntryPtr, dumpID, tapename, tapeSeq, useCount, written,
{
afs_int32 code = 0;
bzero(aTapeEntryPtr, sizeof(struct budb_tapeEntry));
memset(aTapeEntryPtr, 0, sizeof(struct budb_tapeEntry));
strcpy(aTapeEntryPtr->name, tapename);
aTapeEntryPtr->flags = BUDB_TAPE_BEINGWRITTEN;
aTapeEntryPtr->written = written; /* When label was written */
@ -221,7 +221,7 @@ afs_int32 addVolume(aVolEntryPtr, dumpID, tapename, volname, volid, cloneDate,
allo = 1;
}
bzero(aVolEntryPtr, sizeof(struct budb_volumeEntry));
memset(aVolEntryPtr, 0, sizeof(struct budb_volumeEntry));
strcpy(aVolEntryPtr->name, volname);
aVolEntryPtr->flags = flags;
aVolEntryPtr->id = volid;
@ -417,7 +417,7 @@ dbWatcher()
break;
}
bcopy(volPtr, &volumes[c], sizeof(struct budb_volumeEntry));
memcpy(&volumes[c], volPtr, sizeof(struct budb_volumeEntry));
free(volPtr);
free(entryPtr);
entryPtr = (dlqlinkP)0;

View File

@ -106,7 +106,7 @@ localtime_r(t, tm)
time_t *t;
struct tm *tm;
{
bcopy(localtime(t), tm, sizeof(struct tm));
memcpy(tm, localtime(t), sizeof(struct tm));
}
#endif
@ -910,7 +910,7 @@ dumpPass(dparamsPtr, passNumber)
}
/* Remember the server and partition the volume exists on */
bzero (&server, sizeof(server));
memset(&server, 0, sizeof(server));
server.sin_addr.s_addr = vldbEntry.serverNumber[e];
server.sin_port = 0;
server.sin_family = AF_INET;
@ -1124,7 +1124,7 @@ Dumper(nodePtr)
TapeLog(2, taskId, 0, 0, "Dump %s\n", nodePtr->dumpSetName);
/* setup the dump parameters */
bzero(&dparams, sizeof(dparams));
memset(&dparams, 0, sizeof(dparams));
dparams.node = nodePtr;
dparams.tapeInfoPtr = &tapeInfo;
dlqInit(&savedEntries);
@ -1180,7 +1180,7 @@ Dumper(nodePtr)
ErrorLog(0, taskId, code, 0, "Can't read backup database\n");
ERROR_EXIT(code);
}
bzero(&dparams.lastDump, sizeof(dparams.lastDump));
memset(&dparams.lastDump, 0, sizeof(dparams.lastDump));
}
code = createDump(&dparams); /* enter dump into database */
@ -1535,7 +1535,7 @@ getDumpTape(dparamsPtr, interactiveFlag, append)
ErrorLog(0, taskId, code, tapeInfoPtr->error,
"Warning: Tape error while reading label (will proceed with dump)\n");
}
bzero(&oldTapeLabel, sizeof(oldTapeLabel));
memset(&oldTapeLabel, 0, sizeof(oldTapeLabel));
}
/* Check if null tape. Prior 3.3, backup tapes have no dump id */
@ -1689,8 +1689,8 @@ getDumpTape(dparamsPtr, interactiveFlag, append)
*/
for (dmp=oldTapeLabel.dumpid; dmp; dmp=de.appendedDumpID) {
if (dmp == dparamsPtr->lastDump.id) {
bcopy(&dparamsPtr->lastDump, &de, sizeof(de));
bcopy(&dparamsPtr->lastDump, &de2, sizeof(de2));
memcpy(&de, &dparamsPtr->lastDump, sizeof(de));
memcpy(&de2, &dparamsPtr->lastDump, sizeof(de2));
}
else {
code = bcdb_FindDumpByID(dmp, &de);
@ -1831,7 +1831,7 @@ makeVolumeHeader(vhptr, dparamsPtr, fragmentNumber)
curDump = &nodePtr->dumps[dparamsPtr->curVolume];
bzero(vhptr, sizeof(*vhptr));
memset(vhptr, 0, sizeof(*vhptr));
strcpy(vhptr->volumeName, curDump->name);
vhptr->volumeID = curDump->vid;
vhptr->cloneDate = curDump->cloneDate;
@ -1876,7 +1876,7 @@ volumeHeader_hton(hostPtr, netPtr)
volHdr.versionflags = htonl(hostPtr->versionflags);
volHdr.cloneDate = htonl(hostPtr->cloneDate);
bcopy(&volHdr, netPtr, sizeof(struct volumeHeader));
memcpy(netPtr, &volHdr, sizeof(struct volumeHeader));
}
/* database related routines */
@ -1890,7 +1890,7 @@ createDump(dparamsPtr)
afs_int32 code = 0;
dumpPtr = &dparamsPtr->dump;
bzero(dumpPtr, sizeof(*dumpPtr));
memset(dumpPtr, 0, sizeof(*dumpPtr));
/* id filled in by database */
dumpPtr->parent = nodePtr->parent;

View File

@ -74,7 +74,7 @@ struct dumpNode **newNode;
/* get space */
*newNode = (struct dumpNode *) (malloc (sizeof (struct dumpNode)));
bzero(*newNode, sizeof(struct dumpNode));
memset(*newNode, 0, sizeof(struct dumpNode));
(*newNode)->next = dumpQHeader->next;
dumpQHeader->next = *newNode;

Some files were not shown because too many files have changed in this diff Show More