summaryrefslogtreecommitdiff
path: root/pfinet
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 /pfinet
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 'pfinet')
-rw-r--r--pfinet/glue-include/asm/uaccess.h2
-rw-r--r--pfinet/io-ops.c2
-rw-r--r--pfinet/options.c4
-rw-r--r--pfinet/socket.c2
-rw-r--r--pfinet/timer-emul.c2
5 files changed, 6 insertions, 6 deletions
diff --git a/pfinet/glue-include/asm/uaccess.h b/pfinet/glue-include/asm/uaccess.h
index 6f6dc413..752c61c0 100644
--- a/pfinet/glue-include/asm/uaccess.h
+++ b/pfinet/glue-include/asm/uaccess.h
@@ -43,7 +43,7 @@ struct __large_struct { unsigned long buf[100]; };
#define copy_to_user(to,from,n) (memcpy ((to), (from), (n)), 0)
#define copy_from_user(to,from,n) (memcpy ((to), (from), (n)), 0)
-#define clear_user(mem, len) (bzero ((mem), (len)), 0)
+#define clear_user(mem, len) (memset ((mem), 0, (len)), 0)
#define copy_to_user_ret(to,from,n,retval) ({ if (copy_to_user(to,from,n)) return retval; })
diff --git a/pfinet/io-ops.c b/pfinet/io-ops.c
index 96dbec85..cc666cd6 100644
--- a/pfinet/io-ops.c
+++ b/pfinet/io-ops.c
@@ -339,7 +339,7 @@ S_io_stat (struct sock_user *user,
if (!user)
return EOPNOTSUPP;
- bzero (st, sizeof (struct stat));
+ memset (st, 0, sizeof(struct stat));
st->st_fstype = FSTYPE_SOCKET;
st->st_fsid = getpid ();
diff --git a/pfinet/options.c b/pfinet/options.c
index e9b81a9c..4b143563 100644
--- a/pfinet/options.c
+++ b/pfinet/options.c
@@ -418,8 +418,8 @@ parse_opt (int opt, char *arg, struct argp_state *state)
req.nlh.nlmsg_seq = 0;
req.nlh.nlmsg_len = NLMSG_LENGTH (sizeof req.rtm);
- bzero (&req.rtm, sizeof req.rtm);
- bzero (&rta, sizeof rta);
+ memset (&req.rtm, 0, sizeof req.rtm);
+ memset (&rta, 0, sizeof rta);
req.rtm.rtm_scope = RT_SCOPE_UNIVERSE;
req.rtm.rtm_type = RTN_UNICAST;
req.rtm.rtm_protocol = RTPROT_STATIC;
diff --git a/pfinet/socket.c b/pfinet/socket.c
index 23a2dd91..06ce2c7e 100644
--- a/pfinet/socket.c
+++ b/pfinet/socket.c
@@ -50,7 +50,7 @@ sock_alloc (void)
return 0;
c = (void *) &sock[1];
pthread_cond_init (c, NULL);
- bzero (sock, sizeof *sock);
+ memset (sock, 0, sizeof *sock);
sock->state = SS_UNCONNECTED;
sock->identity = MACH_PORT_NULL;
sock->refcnt = 1;
diff --git a/pfinet/timer-emul.c b/pfinet/timer-emul.c
index f6760d7e..2053f80f 100644
--- a/pfinet/timer-emul.c
+++ b/pfinet/timer-emul.c
@@ -152,7 +152,7 @@ mod_timer (struct timer_list *timer, unsigned long expires)
void
init_timer (struct timer_list *timer)
{
- bzero (timer, sizeof (struct timer_list));
+ memset (timer, 0, sizeof(struct timer_list));
}
void