diff options
author | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2012-10-10 17:42:12 +0900 |
---|---|---|
committer | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2012-10-11 14:24:07 +0900 |
commit | c8f2f41b1faeb99cb145507567bc7c84092dd17c (patch) | |
tree | da299561a301f6b760ed9844041217e2d3d35a96 /ninfod | |
parent | 0fd6dec9390d81ef8a75bc04c909c124329639e1 (diff) | |
download | iputils-c8f2f41b1faeb99cb145507567bc7c84092dd17c.tar.gz |
ninfod: Use __func__ instead of __FUNCTION__.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Diffstat (limited to 'ninfod')
-rw-r--r-- | ninfod/ninfod.c | 6 | ||||
-rw-r--r-- | ninfod/ninfod.h | 4 | ||||
-rw-r--r-- | ninfod/ninfod_addrs.c | 12 | ||||
-rw-r--r-- | ninfod/ninfod_core.c | 28 | ||||
-rw-r--r-- | ninfod/ninfod_name.c | 8 |
5 files changed, 29 insertions, 29 deletions
diff --git a/ninfod/ninfod.c b/ninfod/ninfod.c index 318e001..27531cc 100644 --- a/ninfod/ninfod.c +++ b/ninfod/ninfod.c @@ -235,7 +235,7 @@ int ni_recv(struct packetcontext *p) struct cmsghdr *cmsg; int cc; - DEBUG(LOG_DEBUG, "%s()\n", __FUNCTION__); + DEBUG(LOG_DEBUG, "%s()\n", __func__); memset(&iov, 0, sizeof(iov)); iov[0].iov_base = p->query; @@ -282,7 +282,7 @@ int ni_send(struct packetcontext *p) struct cmsghdr *cmsg; int cc; - DEBUG(LOG_DEBUG, "%s()\n", __FUNCTION__); + DEBUG(LOG_DEBUG, "%s()\n", __func__); memset(&iov, 0, sizeof(iov)); iov[0].iov_base = &p->reply; @@ -511,7 +511,7 @@ int main (int argc, char **argv) p = ni_malloc(sizeof(*p)); if (!p) { DEBUG(LOG_WARNING, "%s(): failed to allocate packet context; sleep 1 sec.\n", - __FUNCTION__); + __func__); sleep(1); continue; } diff --git a/ninfod/ninfod.h b/ninfod/ninfod.h index 6a716a4..d0c1779 100644 --- a/ninfod/ninfod.h +++ b/ninfod/ninfod.h @@ -103,13 +103,13 @@ void stderrlog(int priority, char *format, ...); #define ni_malloc(size) ({ \ size_t _size = (size); \ void *p = malloc(_size); \ - DEBUG(LOG_DEBUG, "%s(): malloc(%zu) = %p\n", __FUNCTION__, _size, p); \ + DEBUG(LOG_DEBUG, "%s(): malloc(%zu) = %p\n", __func__, _size, p); \ p; \ }) #define ni_free(p) ({ \ void *_p = (p); \ int saved_errno = errno; \ - DEBUG(LOG_DEBUG, "%s(): free(%p)\n", __FUNCTION__, _p); \ + DEBUG(LOG_DEBUG, "%s(): free(%p)\n", __func__, _p); \ free(_p); \ errno = saved_errno; \ }) diff --git a/ninfod/ninfod_addrs.c b/ninfod/ninfod_addrs.c index 4b03d21..448121f 100644 --- a/ninfod/ninfod_addrs.c +++ b/ninfod/ninfod_addrs.c @@ -129,7 +129,7 @@ static char *RCSID __attribute__ ((unused)) = "$USAGI: ninfod_addrs.c,v 1.18 200 /* ipv6 address */ void init_nodeinfo_ipv6addr(INIT_ARGS) { - DEBUG(LOG_DEBUG, "%s()\n", __FUNCTION__); + DEBUG(LOG_DEBUG, "%s()\n", __func__); return; } @@ -154,12 +154,12 @@ int pr_nodeinfo_ipv6addr(CHECKANDFILL_ARGS) struct ni_ifaddrs *ifa0; unsigned int ifindex = 0; - DEBUG(LOG_DEBUG, "%s()\n", __FUNCTION__); + DEBUG(LOG_DEBUG, "%s()\n", __func__); if (subject && subjlen != sizeof(struct in6_addr)) { DEBUG(LOG_INFO, "%s(): invalid subject length %zu for IPv6 Address Subject\n", - __FUNCTION__, subjlen); + __func__, subjlen); return 1; } if (ni_ifaddrs(&ifa0, AF_INET6)) @@ -309,7 +309,7 @@ int pr_nodeinfo_ipv6addr(CHECKANDFILL_ARGS) /* ipv4 address */ void init_nodeinfo_ipv4addr(INIT_ARGS) { - DEBUG(LOG_DEBUG, "%s()\n", __FUNCTION__); + DEBUG(LOG_DEBUG, "%s()\n", __func__); return; } @@ -323,12 +323,12 @@ int pr_nodeinfo_ipv4addr(CHECKANDFILL_ARGS) struct ni_ifaddrs *ifa0; unsigned int ifindex = 0; - DEBUG(LOG_DEBUG, "%s()\n", __FUNCTION__); + DEBUG(LOG_DEBUG, "%s()\n", __func__); if (subject && subjlen != sizeof(struct in_addr)) { DEBUG(LOG_INFO, "%s(): invalid subject length %zu for IPv4 Address Subject\n", - __FUNCTION__, subjlen); + __func__, subjlen); return 1; } if (ni_ifaddrs(&ifa0, AF_INET)) diff --git a/ninfod/ninfod_core.c b/ninfod/ninfod_core.c index c9f34c5..77be9d9 100644 --- a/ninfod/ninfod_core.c +++ b/ninfod/ninfod_core.c @@ -241,12 +241,12 @@ int pr_nodeinfo_noop(CHECKANDFILL_ARGS) { struct icmp6_nodeinfo *replybuf = NULL; - DEBUG(LOG_DEBUG, "%s()\n", __FUNCTION__); + DEBUG(LOG_DEBUG, "%s()\n", __func__); if (subjlen) { DEBUG(LOG_WARNING, "%s(): invalid subject length(%zu)\n", - __FUNCTION__, subjlen); + __func__, subjlen); return 1; } @@ -270,11 +270,11 @@ int pr_nodeinfo_suptypes(CHECKANDFILL_ARGS) { size_t replylen = sizeof(struct icmp6_nodeinfo) + (suptypes_len<<2); - DEBUG(LOG_DEBUG, "%s()\n", __FUNCTION__); + DEBUG(LOG_DEBUG, "%s()\n", __func__); if (subjlen) { DEBUG(LOG_WARNING, "%s(): invalid subject length(%zu)\n", - __FUNCTION__, subjlen); + __func__, subjlen); return 1; } @@ -372,7 +372,7 @@ void init_core(int forced) { int i; - DEBUG(LOG_DEBUG, "%s()\n", __FUNCTION__); + DEBUG(LOG_DEBUG, "%s()\n", __func__); if (!initialized || forced) { struct timeval tv; @@ -380,7 +380,7 @@ void init_core(int forced) pid_t pid; if (gettimeofday(&tv, NULL) < 0) { - DEBUG(LOG_WARNING, "%s(): failed to gettimeofday()\n", __FUNCTION__); + DEBUG(LOG_WARNING, "%s(): failed to gettimeofday()\n", __func__); } else { seed = (tv.tv_usec & 0xffffffff); } @@ -422,9 +422,9 @@ void init_core(int forced) static void *ni_send_thread(void *data) { int ret; - DEBUG(LOG_DEBUG, "%s(): thread=%ld\n", __FUNCTION__, pthread_self()); + DEBUG(LOG_DEBUG, "%s(): thread=%ld\n", __func__, pthread_self()); ret = ni_send(data); - DEBUG(LOG_DEBUG, "%s(): thread=%ld => %d\n", __FUNCTION__, pthread_self(), ret); + DEBUG(LOG_DEBUG, "%s(): thread=%ld => %d\n", __func__, pthread_self(), ret); return NULL; } #else @@ -440,10 +440,10 @@ static int ni_send_fork(struct packetcontext *p) if (grandchild == 0) { int ret; DEBUG(LOG_DEBUG, "%s(): worker=%d\n", - __FUNCTION__, getpid()); + __func__, getpid()); ret = ni_send(p); DEBUG(LOG_DEBUG, "%s(): worker=%d => %d\n", - __FUNCTION__, getpid(), ret); + __func__, getpid(), ret); } ni_free(p->replydata); ni_free(p); @@ -464,7 +464,7 @@ static int ni_ratelimit(void) if (gettimeofday(&tv, NULL) < 0) { DEBUG(LOG_WARNING, "%s(): gettimeofday(): %s\n", - __FUNCTION__, strerror(errno)); + __func__, strerror(errno)); return -1; } @@ -514,7 +514,7 @@ int pr_nodeinfo(struct packetcontext *p) cp += sprintf(cp, " %02x", query->icmp6_ni_nonce[i]); } DEBUG(LOG_DEBUG, "%s(): qtype=%d, flags=0x%04x, nonce[] = {%s }\n", - __FUNCTION__, + __func__, ntohs(query->ni_qtype), ntohs(query->ni_flags), printbuf); #endif @@ -527,7 +527,7 @@ int pr_nodeinfo(struct packetcontext *p) if (query->ni_code != ICMP6_NI_SUBJ_FQDN) { DEBUG(LOG_WARNING, "%s(): invalid/unknown code %u\n", - __FUNCTION__, query->ni_code); + __func__, query->ni_code); subjlen = 0; } subjinfo = &subjinfo_null; @@ -537,7 +537,7 @@ int pr_nodeinfo(struct packetcontext *p) if (!subjinfo) { DEBUG(LOG_WARNING, "%s(): unknown code %u\n", - __FUNCTION__, query->ni_code); + __func__, query->ni_code); ni_free(p); return -1; } diff --git a/ninfod/ninfod_name.c b/ninfod/ninfod_name.c index 6a97fbd..3401ffe 100644 --- a/ninfod/ninfod_name.c +++ b/ninfod/ninfod_name.c @@ -285,7 +285,7 @@ void init_nodeinfo_nodename(int forced) int len; int changed = 0; - DEBUG(LOG_DEBUG, "%s()\n", __FUNCTION__); + DEBUG(LOG_DEBUG, "%s()\n", __func__); uname(&newname); changed = strcmp(newname.nodename, utsname.nodename); @@ -305,7 +305,7 @@ void init_nodeinfo_nodename(int forced) #endif DEBUG(LOG_WARNING, "%s(): failed to leave group %s.\n", - __FUNCTION__, niaddrbuf); + __func__, niaddrbuf); memset(&nigroup, 0, sizeof(nigroup)); } } @@ -332,7 +332,7 @@ void init_nodeinfo_nodename(int forced) #endif DEBUG(LOG_WARNING, "%s(): failed to join group %s.\n", - __FUNCTION__, niaddrbuf); + __func__, niaddrbuf); memset(&nigroup, 0, sizeof(nigroup)); } } else { @@ -347,7 +347,7 @@ void init_nodeinfo_nodename(int forced) /* nodename */ int pr_nodeinfo_nodename(CHECKANDFILL_ARGS) { - DEBUG(LOG_DEBUG, "%s()\n", __FUNCTION__); + DEBUG(LOG_DEBUG, "%s()\n", __func__); if (subject) { if (!nodenamelen || |