summaryrefslogtreecommitdiff
path: root/src/udev/udevd.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/udevd.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/udevd.c')
-rw-r--r--src/udev/udevd.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/udev/udevd.c b/src/udev/udevd.c
index 224763eaa5..ae2067cddf 100644
--- a/src/udev/udevd.c
+++ b/src/udev/udevd.c
@@ -247,12 +247,12 @@ static void worker_new(struct event *event)
goto out;
}
- memset(&ep_signal, 0, sizeof(struct epoll_event));
+ memzero(&ep_signal, sizeof(struct epoll_event));
ep_signal.events = EPOLLIN;
ep_signal.data.fd = fd_signal;
fd_monitor = udev_monitor_get_fd(worker_monitor);
- memset(&ep_monitor, 0, sizeof(struct epoll_event));
+ memzero(&ep_monitor, sizeof(struct epoll_event));
ep_monitor.events = EPOLLIN;
ep_monitor.data.fd = fd_monitor;
@@ -303,7 +303,7 @@ static void worker_new(struct event *event)
udev_monitor_send_device(worker_monitor, NULL, dev);
/* send udevd the result of the event execution */
- memset(&msg, 0, sizeof(struct worker_message));
+ memzero(&msg, sizeof(struct worker_message));
if (err != 0)
msg.exitcode = err;
msg.pid = getpid();
@@ -1183,23 +1183,23 @@ int main(int argc, char *argv[])
goto exit;
}
- memset(&ep_ctrl, 0, sizeof(struct epoll_event));
+ memzero(&ep_ctrl, sizeof(struct epoll_event));
ep_ctrl.events = EPOLLIN;
ep_ctrl.data.fd = fd_ctrl;
- memset(&ep_inotify, 0, sizeof(struct epoll_event));
+ memzero(&ep_inotify, sizeof(struct epoll_event));
ep_inotify.events = EPOLLIN;
ep_inotify.data.fd = fd_inotify;
- memset(&ep_signal, 0, sizeof(struct epoll_event));
+ memzero(&ep_signal, sizeof(struct epoll_event));
ep_signal.events = EPOLLIN;
ep_signal.data.fd = fd_signal;
- memset(&ep_netlink, 0, sizeof(struct epoll_event));
+ memzero(&ep_netlink, sizeof(struct epoll_event));
ep_netlink.events = EPOLLIN;
ep_netlink.data.fd = fd_netlink;
- memset(&ep_worker, 0, sizeof(struct epoll_event));
+ memzero(&ep_worker, sizeof(struct epoll_event));
ep_worker.events = EPOLLIN;
ep_worker.data.fd = fd_worker;