diff options
author | Greg KH <gregkh@linuxfoundation.org> | 2014-01-31 06:51:32 +0100 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2014-01-31 11:55:01 +0100 |
commit | 29804cc1e0f37ee34301530fd7f1eb8550be464e (patch) | |
tree | ba287b984b216279bb342579a9d1039383ca3a39 /src/udev/udevd.c | |
parent | b5cfa7408c4cb68e9bb232fc34b07fd03c915617 (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).
Diffstat (limited to 'src/udev/udevd.c')
-rw-r--r-- | src/udev/udevd.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/udev/udevd.c b/src/udev/udevd.c index 0dfad762f1..dca62f2429 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(); @@ -1159,23 +1159,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; |