summaryrefslogtreecommitdiff
path: root/libstore
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2014-12-01 23:55:25 +0100
committerJustus Winter <4winter@informatik.uni-hamburg.de>2014-12-10 13:45:05 +0100
commit0a4ada8d40fb687a659161ff7e0d1d0994264402 (patch)
tree9bba4a3017b9943de69c112e7e6d8aa3f04afefe /libstore
parent51c2bd7408b0a4ee73ecd1928d4c17d4fafb1ec2 (diff)
Replace `bzero' with `memset'
For reference, this patch was created using the following semantic patch, and then manually applying the change in all functions containing nested functions, as those are not supported by Coccinelle. @@ expression A, B; @@ - bzero (A, B) + memset (A, 0, B) * auth/auth.c: Replace `bzero' with `memset'. * boot/boot.c: Likewise. * defpager/defpager.c: Likewise. * exec/exec.c: Likewise. Also, drop `safe_bzero' and just use `hurd_safe_memset' directly. * ext2fs/ext2fs.c: Likewise. * ext2fs/getblk.c: Likewise. * ext2fs/pager.c: Likewise. * fatfs/pager.c: Likewise. * ftpfs/dir.c: Likewise. * ftpfs/netfs.c: Likewise. * isofs/inode.c: Likewise. * isofs/pager.c: Likewise. * libdiskfs/file-getfh.c: Likewise. * libdiskfs/file-statfs.c: Likewise. * libfshelp/fetch-root.c: Likewise. * libfshelp/start-translator.c: Likewise. * libftpconn/create.c: Likewise. * libftpconn/open.c: Likewise. * libftpconn/unix.c: Likewise. * libpipe/pipe.c: Likewise. * libps/procstat.c: Likewise. * libps/spec.c: Likewise. * libshouldbeinlibc/cacheq.c: Likewise. * libshouldbeinlibc/idvec.c: Likewise. * libshouldbeinlibc/ugids.c: Likewise. * libstore/argp.c: Likewise. * libstore/enc.c: Likewise. * libstore/kids.c: Likewise. * libthreads/alpha/thread.c: Likewise. * libtreefs/fsys.c: Likewise. * libtrivfs/file-statfs.c: Likewise. * mach-defpager/default_pager.c: Likewise. * pfinet/glue-include/asm/uaccess.h: Likewise. * pfinet/io-ops.c: Likewise. * pfinet/options.c: Likewise. * pfinet/socket.c: Likewise. * pfinet/timer-emul.c: Likewise. * pflocal/io.c: Likewise. * startup/startup.c: Likewise. * storeio/storeio.c: Likewise. * sutils/fstab.c: Likewise. * usermux/usermux.c: Likewise. * utils/fakeauth.c: Likewise. * utils/frobauth.c: Likewise. * utils/login.c: Likewise. * utils/x.c: Likewise.
Diffstat (limited to 'libstore')
-rw-r--r--libstore/argp.c2
-rw-r--r--libstore/enc.c4
-rw-r--r--libstore/kids.c2
3 files changed, 4 insertions, 4 deletions
diff --git a/libstore/argp.c b/libstore/argp.c
index 6ed79964..73146a8d 100644
--- a/libstore/argp.c
+++ b/libstore/argp.c
@@ -350,7 +350,7 @@ parse_opt (int opt, char *arg, struct argp_state *state)
parsed = state->hook = malloc (sizeof (struct store_parsed));
if (! parsed)
return ENOMEM;
- bzero (parsed, sizeof (struct store_parsed));
+ memset (parsed, 0, sizeof(struct store_parsed));
parsed->classes = params->classes;
parsed->default_type =
find_class (params->default_type ?: DEFAULT_STORE_CLASS.name,
diff --git a/libstore/enc.c b/libstore/enc.c
index d5002a0e..5838c172 100644
--- a/libstore/enc.c
+++ b/libstore/enc.c
@@ -33,7 +33,7 @@ store_enc_init (struct store_enc *enc,
off_t *offsets, mach_msg_type_number_t num_offsets,
char *data, mach_msg_type_number_t data_len)
{
- bzero (enc, sizeof (*enc));
+ memset (enc, 0, sizeof(*enc));
enc->ports = enc->init_ports = ports;
enc->num_ports = num_ports;
@@ -75,7 +75,7 @@ store_enc_dealloc (struct store_enc *enc)
munmap (enc->data, enc->data_len);
/* For good measure... */
- bzero (enc, sizeof (*enc));
+ memset (enc, 0, sizeof(*enc));
}
/* Copy out the parameters from ENC into the given variables suitably for
diff --git a/libstore/kids.c b/libstore/kids.c
index 901a7f85..5ad94543 100644
--- a/libstore/kids.c
+++ b/libstore/kids.c
@@ -206,7 +206,7 @@ store_open_children (const char *name, int flags,
if (! *stores)
return ENOMEM;
- bzero (*stores, count * sizeof (struct store *));
+ memset (*stores, 0, count * sizeof(struct store *));
/* Open each child store. */
for (p = name, k = 0; !err && p && p[1]; p = end, k++)