Skip to content

Commit

Permalink
master: revert i_zero change on sd-daemon.c
Browse files Browse the repository at this point in the history
  • Loading branch information
mrannanj committed Dec 27, 2016
1 parent 16bb1ac commit 27de85b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/master/sd-daemon.c
Expand Up @@ -131,7 +131,7 @@ int sd_is_fifo(int fd, const char *path) {
if (fd < 0)
return -EINVAL;

i_zero(&st_fd);
memset(&st_fd, 0, sizeof(st_fd));
if (fstat(fd, &st_fd) < 0)
return -errno;

Expand All @@ -141,7 +141,7 @@ int sd_is_fifo(int fd, const char *path) {
if (path) {
struct stat st_path;

i_zero(&st_path);
memset(&st_path, 0, sizeof(st_path));
if (stat(path, &st_path) < 0) {

if (errno == ENOENT || errno == ENOTDIR)
Expand Down Expand Up @@ -222,7 +222,7 @@ int sd_is_socket(int fd, int family, int type, int listening) {
union sockaddr_union sockaddr;
socklen_t l;

i_zero(&sockaddr);
memset(&sockaddr, 0, sizeof(sockaddr));
l = sizeof(sockaddr);

if (getsockname(fd, &sockaddr.sa, &l) < 0)
Expand All @@ -248,7 +248,7 @@ int sd_is_socket_inet(int fd, int family, int type, int listening, uint16_t port
if ((r = sd_is_socket_internal(fd, type, listening)) <= 0)
return r;

i_zero(&sockaddr);
memset(&sockaddr, 0, sizeof(sockaddr));
l = sizeof(sockaddr);

if (getsockname(fd, &sockaddr.sa, &l) < 0)
Expand Down Expand Up @@ -290,7 +290,7 @@ int sd_is_socket_unix(int fd, int type, int listening, const char *path, size_t
if ((r = sd_is_socket_internal(fd, type, listening)) <= 0)
return r;

i_zero(&sockaddr);
memset(&sockaddr, 0, sizeof(sockaddr));
l = sizeof(sockaddr);

if (getsockname(fd, &sockaddr.sa, &l) < 0)
Expand Down Expand Up @@ -354,18 +354,18 @@ int sd_notify(int unset_environment, const char *state) {
goto finish;
}

i_zero(&sockaddr);
memset(&sockaddr, 0, sizeof(sockaddr));
sockaddr.sa.sa_family = AF_UNIX;
strncpy(sockaddr.un.sun_path, e, sizeof(sockaddr.un.sun_path));

if (sockaddr.un.sun_path[0] == '@')
sockaddr.un.sun_path[0] = 0;

i_zero(&iovec);
memset(&iovec, 0, sizeof(iovec));
iovec.iov_base = (char*) state;
iovec.iov_len = strlen(state);

i_zero(&msghdr);
memset(&msghdr, 0, sizeof(msghdr));
msghdr.msg_name = &sockaddr;
msghdr.msg_namelen = offsetof(struct sockaddr_un, sun_path) + strlen(e);

Expand Down

0 comments on commit 27de85b

Please sign in to comment.