summaryrefslogtreecommitdiff
path: root/src/udev/udev-event.c
diff options
context:
space:
mode:
authorGreg KH <gregkh@linuxfoundation.org>2014-02-02 07:15:23 -0500
committerAnthony G. Basile <blueness@gentoo.org>2014-02-02 07:15:23 -0500
commit8fe035158681d0324ff2be99a67bc0434da6faad (patch)
treec9a82a131e2597a62ed392355e39dfc7a888da9d /src/udev/udev-event.c
parent7eefa0ad0db267d99448fcddff2aebb4ebc33f6f (diff)
use memzero(foo, length); for all memset(foo, 0, length); calls
In trying to track down a stupid linker bug, I noticed a bunch of memset() calls that should be using memzero() to make it more "obvious" that the options are correct (i.e. 0 is not the length, but the data to set). So fix up all current calls to memset(foo, 0, length) to memzero(foo, length). Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src/udev/udev-event.c')
-rw-r--r--src/udev/udev-event.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/udev/udev-event.c b/src/udev/udev-event.c
index d4a54faf13..01d579b455 100644
--- a/src/udev/udev-event.c
+++ b/src/udev/udev-event.c
@@ -441,7 +441,7 @@ static void spawn_read(struct udev_event *event,
}
if (fd_stdout >= 0) {
- memset(&ep_outpipe, 0, sizeof(struct epoll_event));
+ memzero(&ep_outpipe, sizeof(struct epoll_event));
ep_outpipe.events = EPOLLIN;
ep_outpipe.data.ptr = &fd_stdout;
if (epoll_ctl(fd_ep, EPOLL_CTL_ADD, fd_stdout, &ep_outpipe) < 0) {
@@ -451,7 +451,7 @@ static void spawn_read(struct udev_event *event,
}
if (fd_stderr >= 0) {
- memset(&ep_errpipe, 0, sizeof(struct epoll_event));
+ memzero(&ep_errpipe, sizeof(struct epoll_event));
ep_errpipe.events = EPOLLIN;
ep_errpipe.data.ptr = &fd_stderr;
if (epoll_ctl(fd_ep, EPOLL_CTL_ADD, fd_stderr, &ep_errpipe) < 0) {
@@ -774,7 +774,8 @@ static int rename_netif_dev_fromname_toname(struct udev_device *dev,const char *
return err;
}
- memset(&ifr, 0x00, sizeof(struct ifreq));
+ memzero(&ifr, sizeof(struct ifreq));
+
strscpy(ifr.ifr_name, IFNAMSIZ, oldname);
strscpy(ifr.ifr_newname, IFNAMSIZ, newname);
err = ioctl(sk, SIOCSIFNAME, &ifr);