rpc_set_error(nfs->rpc, "out of memory. failed to allocate memory for nfs mount data");
return -1;
}
- bzero((char *)data, sizeof(struct nfs_cb_data));
+ memset(data, 0, sizeof(struct nfs_cb_data));
new_server = strdup(server);
new_export = strdup(export);
if (nfs->server != NULL) {
rpc_set_error(nfs->rpc, "out of memory: failed to allocate nfs_cb_data structure");
return -1;
}
- bzero((char *)data, sizeof(struct nfs_cb_data));
+ memset(data, 0, sizeof(struct nfs_cb_data));
data->nfs = nfs;
data->cb = cb;
data->continue_cb = continue_cb;
free_nfs_cb_data(data);
return;
}
- bzero((char *)nfsfh, sizeof(struct nfsfh));
+ memset(nfsfh, 0, sizeof(struct nfsfh));
if (data->continue_int & O_SYNC) {
nfsfh->is_sync = 1;
rpc_set_error(nfs->rpc, "out of memory: failed to allocate nfs_cb_data structure");
return -1;
}
- bzero((char *)data, sizeof(struct nfs_cb_data));
+ memset(data, 0, sizeof(struct nfs_cb_data));
data->nfs = nfs;
data->cb = cb;
data->private_data = private_data;
rpc_set_error(nfs->rpc, "out of memory: failed to allocate nfs_mcb_data structure");
return -1;
}
- bzero((char *)mdata, sizeof(struct nfs_mcb_data));
+ memset(mdata, 0, sizeof(struct nfs_mcb_data));
mdata->data = data;
mdata->offset = offset;
mdata->count = readcount;
rpc_set_error(nfs->rpc, "out of memory: failed to allocate nfs_cb_data structure");
return -1;
}
- bzero((char *)data, sizeof(struct nfs_cb_data));
+ memset(data, 0, sizeof(struct nfs_cb_data));
data->nfs = nfs;
data->cb = cb;
data->private_data = private_data;
rpc_set_error(nfs->rpc, "out of memory: failed to allocate nfs_cb_data structure");
return -1;
}
- bzero((char *)data, sizeof(struct nfs_cb_data));
+ memset(data, 0, sizeof(struct nfs_cb_data));
data->nfs = nfs;
data->cb = cb;
data->private_data = private_data;
rpc_set_error(nfs->rpc, "out of memory: failed to allocate nfs_cb_data structure");
return -1;
}
- bzero((char *)data, sizeof(struct nfs_cb_data));
+ memset(data, 0, sizeof(struct nfs_cb_data));
data->nfs = nfs;
data->cb = cb;
data->private_data = private_data;
rpc_set_error(nfs->rpc, "out of memory: failed to allocate nfs_cb_data structure");
return -1;
}
- bzero((char *)data, sizeof(struct nfs_cb_data));
+ memset(data, 0, sizeof(struct nfs_cb_data));
data->nfs = nfs;
data->cb = cb;
data->private_data = private_data;
- bzero((char *)&args, sizeof(SETATTR3args));
+ memset(&args, 0, sizeof(SETATTR3args));
args.object.data.data_len = nfsfh->fh.data.data_len;
args.object.data.data_val = nfsfh->fh.data.data_val;
args.new_attributes.size.set_it = 1;
free_nfs_cb_data(data);
return;
}
- bzero((char *)nfsfh, sizeof(struct nfsfh));
+ memset(nfsfh, 0, sizeof(struct nfsfh));
/* steal the filehandle */
nfsfh->fh.data.data_len = data->fh.data.data_len;
free_nfs_cb_data(data);
return;
}
- bzero((char *)nfsdirent, sizeof(struct nfsdirent));
+ memset(nfsdirent, 0, sizeof(struct nfsdirent));
nfsdirent->name = strdup(entry->name);
if (nfsdirent->name == NULL) {
data->cb(-ENOMEM, nfs, "Failed to allocate dirent->name", data->private_data);
{
cookieverf3 cv;
- bzero((char *)cv, sizeof(cookieverf3));
+ memset(cv, 0, sizeof(cookieverf3));
if (rpc_nfs_readdirplus_async(nfs->rpc, nfs_opendir_cb, &data->fh, 0, (char *)&cv, 8192, data) != 0) {
rpc_set_error(nfs->rpc, "RPC error: Failed to send READDIRPLUS call for %s", data->path);
data->cb(-ENOMEM, nfs, rpc_get_error(nfs->rpc), data->private_data);
rpc_set_error(nfs->rpc, "failed to allocate buffer for nfsdir");
return -1;
}
- bzero((char *)nfsdir, sizeof(struct nfsdir));
+ memset(nfsdir, 0, sizeof(struct nfsdir));
if (nfs_lookuppath_async(nfs, path, cb, private_data, nfs_opendir_continue_internal, nfsdir, free, 0) != 0) {
rpc_set_error(nfs->rpc, "Out of memory: failed to start parsing the path components");
{
SETATTR3args args;
- bzero((char *)&args, sizeof(SETATTR3args));
+ memset(&args, 0, sizeof(SETATTR3args));
args.object.data.data_len = data->fh.data.data_len;
args.object.data.data_val = data->fh.data.data_val;
args.new_attributes.mode.set_it = 1;
rpc_set_error(nfs->rpc, "out of memory. failed to allocate memory for nfs mount data");
return -1;
}
- bzero((char *)data, sizeof(struct nfs_cb_data));
+ memset(data, 0, sizeof(struct nfs_cb_data));
data->nfs = nfs;
data->cb = cb;
data->private_data = private_data;
SETATTR3args args;
struct nfs_chown_data *chown_data = data->continue_data;
- bzero((char *)&args, sizeof(SETATTR3args));
+ memset(&args, 0, sizeof(SETATTR3args));
args.object.data.data_len = data->fh.data.data_len;
args.object.data.data_val = data->fh.data.data_val;
if (chown_data->uid != (uid_t)-1) {
rpc_set_error(nfs->rpc, "out of memory. failed to allocate memory for fchown data");
return -1;
}
- bzero((char *)data, sizeof(struct nfs_cb_data));
+ memset(data, 0, sizeof(struct nfs_cb_data));
data->nfs = nfs;
data->cb = cb;
data->private_data = private_data;
SETATTR3args args;
struct timeval *utimes_data = data->continue_data;
- bzero((char *)&args, sizeof(SETATTR3args));
+ memset(&args, 0, sizeof(SETATTR3args));
args.object.data.data_len = data->fh.data.data_len;
args.object.data.data_val = data->fh.data.data_val;
if (utimes_data != NULL) {
rpc_set_error(nfs->rpc, "Out of memory, failed to allocate buffer for symlink data");
return -1;
}
- bzero((char *)symlink_data, sizeof(struct nfs_symlink_data));
+ memset(symlink_data, 0, sizeof(struct nfs_symlink_data));
symlink_data->oldpath = strdup(oldpath);
if (symlink_data->oldpath == NULL) {
rpc_set_error(nfs->rpc, "Out of memory, failed to allocate buffer for rename data");
return -1;
}
- bzero((char *)rename_data, sizeof(struct nfs_rename_data));
+ memset(rename_data, 0, sizeof(struct nfs_rename_data));
rename_data->oldpath = strdup(oldpath);
if (rename_data->oldpath == NULL) {
rpc_set_error(nfs->rpc, "Out of memory, failed to allocate buffer for link data");
return -1;
}
- bzero((char *)link_data, sizeof(struct nfs_link_data));
+ memset(link_data, 0, sizeof(struct nfs_link_data));
link_data->oldpath = strdup(oldpath);
if (link_data->oldpath == NULL) {
if (data == NULL) {
return -1;
}
- bzero((char *)data, sizeof(struct mount_cb_data));
+ memset(data, 0, sizeof(struct mount_cb_data));
data->cb = cb;
data->private_data = private_data;
data->server = strdup(server);
rpc_set_error(rpc, "Out of memory: Failed to allocate pdu structure");
return NULL;
}
- bzero((char *)pdu, sizeof(struct rpc_pdu));
+ memset(pdu, 0, sizeof(struct rpc_pdu));
pdu->xid = rpc->xid++;
pdu->cb = cb;
pdu->private_data = private_data;
xdr_setpos(&pdu->xdr, 4); /* skip past the record marker */
}
- bzero((char *)&msg, sizeof(struct rpc_msg));
+ memset(&msg, 0, sizeof(struct rpc_msg));
msg.rm_xid = pdu->xid;
msg.rm_direction = CALL;
msg.rm_call.cb_rpcvers = RPC_MSG_VERSION;
{
struct rpc_msg msg;
- bzero((char *)&msg, sizeof(struct rpc_msg));
+ memset(&msg, 0, sizeof(struct rpc_msg));
msg.acpted_rply.ar_verf = _null_auth;
if (pdu->xdr_decode_bufsize > 0) {
if (pdu->xdr_decode_buf != NULL) {
pdu->cb(rpc, RPC_STATUS_ERROR, "Failed to allocate buffer for decoding of XDR reply", pdu->private_data);
return 0;
}
- bzero((char *)pdu->xdr_decode_buf, pdu->xdr_decode_bufsize);
+ memset(pdu->xdr_decode_buf, 0, pdu->xdr_decode_bufsize);
}
msg.acpted_rply.ar_results.where = pdu->xdr_decode_buf;
msg.acpted_rply.ar_results.proc = pdu->xdr_decode_fn;
int pos, recordmarker;
unsigned int xid;
- bzero((char *)&xdr, sizeof(XDR));
+ memset(&xdr, 0, sizeof(XDR));
xdrmem_create(&xdr, buf, size, XDR_DECODE);
if (rpc->is_udp == 0) {
return -1;
}
- bzero((char *)&args, sizeof(MKDIR3args));
+ memset(&args, 0, sizeof(MKDIR3args));
args.where.dir.data.data_len = fh->data.data_len;
args.where.dir.data.data_val = fh->data.data_val;
args.where.name = dir;
return -1;
}
- bzero((char *)&args, sizeof(RMDIR3args));
+ memset(&args, 0, sizeof(RMDIR3args));
args.object.dir.data.data_len = fh->data.data_len;
args.object.dir.data.data_val = fh->data.data_val;
args.object.name = dir;
return -1;
}
- bzero((char *)&args, sizeof(CREATE3args));
+ memset(&args, 0, sizeof(CREATE3args));
args.where.dir.data.data_len = fh->data.data_len;
args.where.dir.data.data_val = fh->data.data_val;
args.where.name = file;
return -1;
}
- bzero((char *)&args, sizeof(REMOVE3args));
+ memset(&args, 0, sizeof(REMOVE3args));
args.object.dir.data.data_len = fh->data.data_len;
args.object.dir.data.data_val = fh->data.data_val;
args.object.name = file;
return -1;
}
- bzero((char *)&args, sizeof(READDIR3args));
+ memset(&args, 0, sizeof(READDIR3args));
args.dir.data.data_len = fh->data.data_len;
args.dir.data.data_val = fh->data.data_val;
args.cookie = cookie;
return -1;
}
- bzero((char *)&args, sizeof(READDIRPLUS3args));
+ memset(&args, 0, sizeof(READDIRPLUS3args));
args.dir.data.data_len = fh->data.data_len;
args.dir.data.data_val = fh->data.data_val;
args.cookie = cookie;
return -1;
}
- bzero((char *)&args, sizeof(SYMLINK3args));
+ memset(&args, 0, sizeof(SYMLINK3args));
args.where.dir.data.data_len = fh->data.data_len;
args.where.dir.data.data_val = fh->data.data_val;
args.where.name = newname;
return -1;
}
- bzero((char *)&args, sizeof(RENAME3args));
+ memset(&args, 0, sizeof(RENAME3args));
args.from.dir.data.data_len = olddir->data.data_len;
args.from.dir.data.data_val = olddir->data.data_val;
args.from.name = oldname;
return -1;
}
- bzero((char *)&args, sizeof(LINK3args));
+ memset(&args, 0, sizeof(LINK3args));
args.file.data.data_len = file->data.data_len;
args.file.data.data_val = file->data.data_val;
args.link.dir.data.data_len = newdir->data.data_len;