Standardize log_* format
This commit is contained in:
parent
31d69ceef9
commit
4d632694e6
2
common.h
2
common.h
|
@ -168,7 +168,7 @@ static inline int split_ip_netmask(int family,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (inet_pton(family, str, addr) == 0) {
|
if (inet_pton(family, str, addr) == 0) {
|
||||||
log_error("inet_pton - %s", strerror(errno));
|
log_error("inet_pton - %m");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
12
vrrp_adv.c
12
vrrp_adv.c
|
@ -68,7 +68,7 @@ static int vrrp_adv_eth_build(struct iovec *iov, const uint8_t vrid,
|
||||||
struct ether_header *hdr = iov->iov_base;
|
struct ether_header *hdr = iov->iov_base;
|
||||||
|
|
||||||
if (hdr == NULL) {
|
if (hdr == NULL) {
|
||||||
log_error("[%d] malloc: %s", vrid, strerror(errno));
|
log_error("vrid %d :: malloc - %m", vrid);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@ static int vrrp_adv_ip4_build(struct iovec *iov, const struct vrrp_net *vnet)
|
||||||
struct iphdr *iph = iov->iov_base;
|
struct iphdr *iph = iov->iov_base;
|
||||||
|
|
||||||
if (iph == NULL) {
|
if (iph == NULL) {
|
||||||
log_error("[%d] malloc: %s", vnet->vrid, strerror(errno));
|
log_error("vrid %d :: malloc - %m", vnet->vrid);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -128,7 +128,7 @@ static int vrrp_adv_ip6_build(struct iovec *iov, const struct vrrp_net *vnet)
|
||||||
struct ip6_hdr *ip6h = iov->iov_base;
|
struct ip6_hdr *ip6h = iov->iov_base;
|
||||||
|
|
||||||
if (ip6h == NULL) {
|
if (ip6h == NULL) {
|
||||||
log_error("[%d] malloc: %s", vnet->vrid, strerror(errno));
|
log_error("vrid %d :: malloc - %m", vnet->vrid);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -140,7 +140,7 @@ static int vrrp_adv_ip6_build(struct iovec *iov, const struct vrrp_net *vnet)
|
||||||
memcpy(&ip6h->ip6_src, &vnet->vif.ip_addr6, sizeof(struct in6_addr));
|
memcpy(&ip6h->ip6_src, &vnet->vif.ip_addr6, sizeof(struct in6_addr));
|
||||||
|
|
||||||
if (inet_pton(AF_INET6, IN6ADDR_VRRP_GROUP, &(ip6h->ip6_dst)) != 1) {
|
if (inet_pton(AF_INET6, IN6ADDR_VRRP_GROUP, &(ip6h->ip6_dst)) != 1) {
|
||||||
log_error("[%d] inet_pton: %s", vnet->vrid, strerror(errno));
|
log_error("vrid %d :: inet_pton - %m", vnet->vrid);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -160,7 +160,7 @@ static int vrrp_adv_build(struct iovec *iov, const struct vrrp_net *vnet,
|
||||||
struct vrrphdr *pkt = iov->iov_base;
|
struct vrrphdr *pkt = iov->iov_base;
|
||||||
|
|
||||||
if (pkt == NULL) {
|
if (pkt == NULL) {
|
||||||
log_error("[%d] malloc: %s", vnet->vrid, strerror(errno));
|
log_error("vrid %d :: malloc - %m", vnet->vrid);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -200,7 +200,7 @@ static int vrrp_adv_build(struct iovec *iov, const struct vrrp_net *vnet,
|
||||||
|
|
||||||
if (naddr > vrrp->naddr) {
|
if (naddr > vrrp->naddr) {
|
||||||
log_error
|
log_error
|
||||||
("[%d] Build invalid avd pkt : try to write more vip than expected",
|
("vrid %d :: Build invalid avd pkt, try to write more vip than expected",
|
||||||
vnet->vrid);
|
vnet->vrid);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,7 +70,7 @@ static int vrrp_arp_eth_build(struct iovec *iov, const uint8_t vrid)
|
||||||
struct ether_header *hdr = iov->iov_base;
|
struct ether_header *hdr = iov->iov_base;
|
||||||
|
|
||||||
if (hdr == NULL) {
|
if (hdr == NULL) {
|
||||||
log_error("[%d] malloc: %s", vrid, strerror(errno));
|
log_error("vrid %d :: malloc - %m", vrid);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,7 +110,7 @@ static int vrrp_arp_build(struct iovec *iov, const uint8_t vrid)
|
||||||
struct arphdr *arph = iov->iov_base;
|
struct arphdr *arph = iov->iov_base;
|
||||||
|
|
||||||
if (arph == NULL) {
|
if (arph == NULL) {
|
||||||
log_error("[%d] malloc: %s", vrid, strerror(errno));
|
log_error("vrid %d :: malloc - %m", vrid);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -136,7 +136,7 @@ static int vrrp_arp_vrrp_build(struct iovec *iov, struct vrrp_ip *vip,
|
||||||
struct arphdr_eth *arpeth = iov->iov_base;
|
struct arphdr_eth *arpeth = iov->iov_base;
|
||||||
|
|
||||||
if (arpeth == NULL) {
|
if (arpeth == NULL) {
|
||||||
log_error("[%d] malloc: %s", vnet->vrid, strerror(errno));
|
log_error("vrid %d :: malloc - %m", vnet->vrid);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
14
vrrp_exec.c
14
vrrp_exec.c
|
@ -116,8 +116,8 @@ int vrrp_exec(struct vrrp *vrrp, const struct vrrp_net *vnet, vrrp_state state)
|
||||||
scriptname = vrrp->scriptname;
|
scriptname = vrrp->scriptname;
|
||||||
|
|
||||||
if (!is_file_executable(scriptname)) {
|
if (!is_file_executable(scriptname)) {
|
||||||
log_error("File %s doesn't exist or is not executable",
|
log_error("vrid %d :: File %s doesn't exist or is not executable",
|
||||||
scriptname);
|
vrrp->vrid, scriptname);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,7 +141,7 @@ int vrrp_exec(struct vrrp *vrrp, const struct vrrp_net *vnet, vrrp_state state)
|
||||||
int status, savedErrno;
|
int status, savedErrno;
|
||||||
|
|
||||||
if (child == -1) {
|
if (child == -1) {
|
||||||
log_error("fork: %s", strerror(errno));
|
log_error("vrid %d :: fork - %m", vrrp->vrid);
|
||||||
vrrp_exec_cleanup(vrrp);
|
vrrp_exec_cleanup(vrrp);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -160,7 +160,7 @@ int vrrp_exec(struct vrrp *vrrp, const struct vrrp_net *vnet, vrrp_state state)
|
||||||
/* execve */
|
/* execve */
|
||||||
execve(scriptname, (char *const *) vrrp->argv, NULL);
|
execve(scriptname, (char *const *) vrrp->argv, NULL);
|
||||||
|
|
||||||
log_error("execve: %s", strerror(errno));
|
log_error("vrid %d :: execve - %m", vrrp->vrid);
|
||||||
vrrp_exec_cleanup(vrrp);
|
vrrp_exec_cleanup(vrrp);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -170,7 +170,7 @@ int vrrp_exec(struct vrrp *vrrp, const struct vrrp_net *vnet, vrrp_state state)
|
||||||
|
|
||||||
while (waitpid(child, &status, 0) == -1) {
|
while (waitpid(child, &status, 0) == -1) {
|
||||||
if (errno != EINTR) { /* Error other than EINTR */
|
if (errno != EINTR) { /* Error other than EINTR */
|
||||||
log_error("waitpid: %s", strerror(errno));
|
log_error("vrid %d :: waitpid - %m", vrrp->vrid);
|
||||||
status = -1;
|
status = -1;
|
||||||
break; /* So exit loop */
|
break; /* So exit loop */
|
||||||
}
|
}
|
||||||
|
@ -195,14 +195,14 @@ int vrrp_exec_init(struct vrrp *vrrp)
|
||||||
vrrp->argv = malloc(sizeof(char *) * SCRIPT_NARGS);
|
vrrp->argv = malloc(sizeof(char *) * SCRIPT_NARGS);
|
||||||
|
|
||||||
if (vrrp->argv == NULL) {
|
if (vrrp->argv == NULL) {
|
||||||
log_error("malloc: %s", strerror(errno));
|
log_error("vrid %d :: malloc - %m", vrrp->vrid);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < SCRIPT_NARGS - 1; ++i) {
|
for (int i = 0; i < SCRIPT_NARGS - 1; ++i) {
|
||||||
vrrp->argv[i] = malloc(sizeof(char) * SCRIPT_ARG_MAX);
|
vrrp->argv[i] = malloc(sizeof(char) * SCRIPT_ARG_MAX);
|
||||||
if (vrrp->argv[i] == NULL) {
|
if (vrrp->argv[i] == NULL) {
|
||||||
log_error("malloc: %s", strerror(errno));
|
log_error("vrid %d :: malloc - %m", vrrp->vrid);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
bzero(vrrp->argv[i], sizeof(char) * SCRIPT_ARG_MAX);
|
bzero(vrrp->argv[i], sizeof(char) * SCRIPT_ARG_MAX);
|
||||||
|
|
|
@ -83,8 +83,7 @@ static int vrrp_ip4_mgroup(struct vrrp_net *vnet)
|
||||||
struct in_addr group_addr = { 0 };
|
struct in_addr group_addr = { 0 };
|
||||||
|
|
||||||
if (inet_pton(AF_INET, VRRP_MGROUP4, &group_addr) < 0) {
|
if (inet_pton(AF_INET, VRRP_MGROUP4, &group_addr) < 0) {
|
||||||
log_error("vrid %d :: inet_pton - %s", vnet->vrid,
|
log_error("vrid %d :: inet_pton - %m", vnet->vrid);
|
||||||
strerror(errno));
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
group.imr_multiaddr.s_addr = group_addr.s_addr;
|
group.imr_multiaddr.s_addr = group_addr.s_addr;
|
||||||
|
@ -93,8 +92,7 @@ static int vrrp_ip4_mgroup(struct vrrp_net *vnet)
|
||||||
if (setsockopt
|
if (setsockopt
|
||||||
(vnet->socket, IPPROTO_IP, IP_ADD_MEMBERSHIP, &group,
|
(vnet->socket, IPPROTO_IP, IP_ADD_MEMBERSHIP, &group,
|
||||||
sizeof(struct ip_mreq)) < 0) {
|
sizeof(struct ip_mreq)) < 0) {
|
||||||
log_error("vrid %d :: setsockopt - %s", vnet->vrid,
|
log_error("vrid %d :: setsockopt - %m", vnet->vrid);
|
||||||
strerror(errno));
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
12
vrrp_ip6.c
12
vrrp_ip6.c
|
@ -83,14 +83,14 @@ static int vrrp_ip6_setsockopt(int socket, int vrid)
|
||||||
/* IPV6_RECVPKTINFO */
|
/* IPV6_RECVPKTINFO */
|
||||||
if (setsockopt
|
if (setsockopt
|
||||||
(socket, IPPROTO_IPV6, IPV6_RECVPKTINFO, &on, sizeof(on)) < 0) {
|
(socket, IPPROTO_IPV6, IPV6_RECVPKTINFO, &on, sizeof(on)) < 0) {
|
||||||
log_error("vrid %d :: setsockopt - %s", vrid, strerror(errno));
|
log_error("vrid %d :: setsockopt - %m", vrid);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* IPV6_RECVHOPLIMIT */
|
/* IPV6_RECVHOPLIMIT */
|
||||||
if (setsockopt
|
if (setsockopt
|
||||||
(socket, IPPROTO_IPV6, IPV6_RECVHOPLIMIT, &on, sizeof(on)) < 0) {
|
(socket, IPPROTO_IPV6, IPV6_RECVHOPLIMIT, &on, sizeof(on)) < 0) {
|
||||||
log_error("vrid %d :: setsockopt - %s", vrid, strerror(errno));
|
log_error("vrid %d :: setsockopt - %m", vrid);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,8 +107,7 @@ static int vrrp_ip6_mgroup(struct vrrp_net *vnet)
|
||||||
struct in6_addr group_addr = IN6ADDR_ANY_INIT;
|
struct in6_addr group_addr = IN6ADDR_ANY_INIT;
|
||||||
|
|
||||||
if (inet_pton(AF_INET6, VRRP_MGROUP6, &group_addr) < 0) {
|
if (inet_pton(AF_INET6, VRRP_MGROUP6, &group_addr) < 0) {
|
||||||
log_error("vrid %d :: inet_pton - %s", vnet->vrid,
|
log_error("vrid %d :: inet_pton - %m", vnet->vrid);
|
||||||
strerror(errno));
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,8 +118,7 @@ static int vrrp_ip6_mgroup(struct vrrp_net *vnet)
|
||||||
if (setsockopt
|
if (setsockopt
|
||||||
(vnet->socket, IPPROTO_IPV6, IPV6_ADD_MEMBERSHIP, &group,
|
(vnet->socket, IPPROTO_IPV6, IPV6_ADD_MEMBERSHIP, &group,
|
||||||
sizeof(struct ipv6_mreq)) < 0) {
|
sizeof(struct ipv6_mreq)) < 0) {
|
||||||
log_error("vrid %d :: setsockopt - %s", vnet->vrid,
|
log_error("vrid %d :: setsockopt - %m", vnet->vrid);
|
||||||
strerror(errno));
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -212,7 +210,7 @@ static int vrrp_ip6_recv(int sock_fd, struct vrrp_recv *recv,
|
||||||
len = recvmsg(sock_fd, &msg, 0);
|
len = recvmsg(sock_fd, &msg, 0);
|
||||||
|
|
||||||
if (len < 0) {
|
if (len < 0) {
|
||||||
log_error("recvmsg - %s", strerror(errno));
|
log_error("recvmsg - %m");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -72,7 +72,7 @@ static int vrrp_na_eth_build(struct iovec *iov, const uint8_t vrid)
|
||||||
struct ether_header *hdr = iov->iov_base;
|
struct ether_header *hdr = iov->iov_base;
|
||||||
|
|
||||||
if (hdr == NULL) {
|
if (hdr == NULL) {
|
||||||
log_error("[%d] malloc: %s", vrid, strerror(errno));
|
log_error("vrid %d :: malloc - %m", vrid);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@ static int vrrp_na_ip6_build(struct iovec *iov, struct vrrp_ip *ip,
|
||||||
struct ip6_hdr *ip6h = iov->iov_base;
|
struct ip6_hdr *ip6h = iov->iov_base;
|
||||||
|
|
||||||
if (ip6h == NULL) {
|
if (ip6h == NULL) {
|
||||||
log_error("[%d] malloc: %s", vnet->vrid, strerror(errno));
|
log_error("vrid %d :: malloc - %m", vnet->vrid);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@ static int vrrp_na_ip6_build(struct iovec *iov, struct vrrp_ip *ip,
|
||||||
memcpy(&ip6h->ip6_src, &ip->ip_addr6, sizeof(struct in6_addr));
|
memcpy(&ip6h->ip6_src, &ip->ip_addr6, sizeof(struct in6_addr));
|
||||||
|
|
||||||
if (inet_pton(AF_INET6, IN6ADDR_MCAST, &(ip6h->ip6_dst)) != 1) {
|
if (inet_pton(AF_INET6, IN6ADDR_MCAST, &(ip6h->ip6_dst)) != 1) {
|
||||||
log_error("[%d] inet_pton: %s", vnet->vrid, strerror(errno));
|
log_error("vrid %d :: inet_pton - %m", vnet->vrid);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -166,7 +166,7 @@ static int vrrp_na_build(struct iovec *iov, struct vrrp_ip *ip,
|
||||||
struct nd_neighbor_advert *na = iov->iov_base;
|
struct nd_neighbor_advert *na = iov->iov_base;
|
||||||
|
|
||||||
if (na == NULL) {
|
if (na == NULL) {
|
||||||
log_error("[%d] malloc: %s", vnet->vrid, strerror(errno));
|
log_error("vrid %d :: malloc - %m", vnet->vrid);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
23
vrrp_net.c
23
vrrp_net.c
|
@ -103,8 +103,7 @@ int vrrp_net_socket(struct vrrp_net *vnet)
|
||||||
vnet->socket = socket(vnet->family, SOCK_RAW, IPPROTO_VRRP);
|
vnet->socket = socket(vnet->family, SOCK_RAW, IPPROTO_VRRP);
|
||||||
|
|
||||||
if (vnet->socket < 0) {
|
if (vnet->socket < 0) {
|
||||||
log_error("vrid %d :: socket - %s", vnet->vrid,
|
log_error("vrid %d :: socket - %m", vnet->vrid);
|
||||||
strerror(errno));
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,8 +130,7 @@ int vrrp_net_socket_xmit(struct vrrp_net *vnet)
|
||||||
vnet->xmit = socket(AF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
|
vnet->xmit = socket(AF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
|
||||||
|
|
||||||
if (vnet->xmit < 0) {
|
if (vnet->xmit < 0) {
|
||||||
log_error("vrid %d :: socket xmit - %s", vnet->vrid,
|
log_error("vrid %d :: socket xmit - %m", vnet->vrid);
|
||||||
strerror(errno));
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -150,8 +148,7 @@ int vrrp_net_vif_getaddr(struct vrrp_net *vnet)
|
||||||
int family;
|
int family;
|
||||||
|
|
||||||
if (getifaddrs(&ifaddr) == -1) {
|
if (getifaddrs(&ifaddr) == -1) {
|
||||||
log_error("vrid %d :: getifaddrs - %s", vnet->vrid,
|
log_error("vrid %d :: getifaddrs - %m", vnet->vrid);
|
||||||
strerror(errno));
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -202,7 +199,7 @@ int vrrp_net_vif_mtu(struct vrrp_net *vnet)
|
||||||
ifr.ifr_addr.sa_family = AF_INET;
|
ifr.ifr_addr.sa_family = AF_INET;
|
||||||
|
|
||||||
if (ioctl(fd, SIOCGIFMTU, &ifr) < 0) {
|
if (ioctl(fd, SIOCGIFMTU, &ifr) < 0) {
|
||||||
log_error("vrid %d :: ioctl - %s", vnet->vrid, strerror(errno));
|
log_error("vrid %d :: ioctl - %m", vnet->vrid);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -223,8 +220,7 @@ int vrrp_net_vip_set(struct vrrp_net *vnet, const char *ip)
|
||||||
struct vrrp_ip *vip = malloc(sizeof(struct vrrp_ip));
|
struct vrrp_ip *vip = malloc(sizeof(struct vrrp_ip));
|
||||||
|
|
||||||
if (vip == NULL) {
|
if (vip == NULL) {
|
||||||
log_error("vrid %d :: malloc - %s", vnet->vrid,
|
log_error("vrid %d :: malloc - %m", vnet->vrid);
|
||||||
strerror(errno));
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -327,8 +323,7 @@ int vrrp_net_listen(struct vrrp_net *vnet, struct vrrp *vrrp)
|
||||||
return SIGNAL;
|
return SIGNAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
log_error("vrid %d :: pselect - %s %d", vrrp->vrid,
|
log_error("vrid %d :: pselect - %m", vrrp->vrid);
|
||||||
strerror(errno), errno);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return INVALID;
|
return INVALID;
|
||||||
|
@ -514,8 +509,7 @@ int vrrp_net_send(const struct vrrp_net *vnet, struct iovec *iov, size_t len)
|
||||||
device.sll_ifindex = if_nametoindex(vnet->vif.ifname);
|
device.sll_ifindex = if_nametoindex(vnet->vif.ifname);
|
||||||
|
|
||||||
if (device.sll_ifindex == 0) {
|
if (device.sll_ifindex == 0) {
|
||||||
log_error("vrid %d :: if_nametoindex - %s", vnet->vrid,
|
log_error("vrid %d :: if_nametoindex - %m", vnet->vrid);
|
||||||
strerror(errno));
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -530,8 +524,7 @@ int vrrp_net_send(const struct vrrp_net *vnet, struct iovec *iov, size_t len)
|
||||||
msg.msg_flags = 0;
|
msg.msg_flags = 0;
|
||||||
|
|
||||||
if (sendmsg(vnet->xmit, &msg, 0) < 0) {
|
if (sendmsg(vnet->xmit, &msg, 0) < 0) {
|
||||||
log_error("vrid %d :: sendmsg - %s", vnet->vrid,
|
log_error("vrid %d :: sendmsg - %m", vnet->vrid);
|
||||||
strerror(errno));
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,7 @@ static inline int timespec_substract(struct timespec *result,
|
||||||
int vrrp_timer_set(struct vrrp_timer *timer, time_t delay, long delay_cs)
|
int vrrp_timer_set(struct vrrp_timer *timer, time_t delay, long delay_cs)
|
||||||
{
|
{
|
||||||
if (clock_gettime(CLOCK_MONOTONIC_RAW, &timer->ts) == -1) {
|
if (clock_gettime(CLOCK_MONOTONIC_RAW, &timer->ts) == -1) {
|
||||||
log_error("clock_gettime: %s", strerror(errno));
|
log_error("clock_gettime: %m");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -138,7 +138,7 @@ int vrrp_timer_update(struct vrrp_timer *timer)
|
||||||
struct timespec ts;
|
struct timespec ts;
|
||||||
|
|
||||||
if (clock_gettime(CLOCK_MONOTONIC_RAW, &ts) == -1) {
|
if (clock_gettime(CLOCK_MONOTONIC_RAW, &ts) == -1) {
|
||||||
log_error("clock_gettime: %s", strerror(errno));
|
log_error("clock_gettime: %m");
|
||||||
return -1; /* TODO die() */
|
return -1; /* TODO die() */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue