From 75ddf59ea110117578acd3a7b889549bfb40473c Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 10 Feb 2005 07:39:14 +0000 Subject: r5308: trimmed back a lot of the old macros from smb_macros.h (This used to be commit bf43c9bdcf9e654d123f6a2b29feb9189ca9e561) --- source4/lib/netif/interface.c | 5 +++-- source4/lib/pidfile.c | 2 +- source4/lib/util.c | 6 ++---- 3 files changed, 6 insertions(+), 7 deletions(-) (limited to 'source4/lib') diff --git a/source4/lib/netif/interface.c b/source4/lib/netif/interface.c index 31354e359a..2d90df43cf 100644 --- a/source4/lib/netif/interface.c +++ b/source4/lib/netif/interface.c @@ -272,8 +272,9 @@ BOOL interfaces_changed(void) BOOL ismyip(struct ipv4_addr ip) { struct interface *i; - for (i=local_interfaces;i;i=i->next) - if (ipv4_equal(i->ip,ip)) return True; + for (i=local_interfaces;i;i=i->next) { + if (i->ip.addr == ip.addr) return True; + } return False; } diff --git a/source4/lib/pidfile.c b/source4/lib/pidfile.c index ff05c0606e..b1866ee6af 100644 --- a/source4/lib/pidfile.c +++ b/source4/lib/pidfile.c @@ -44,7 +44,7 @@ pid_t pidfile_pid(const char *name) return 0; } - ZERO_ARRAY(pidstr); + ZERO_STRUCT(pidstr); if (read(fd, pidstr, sizeof(pidstr)-1) <= 0) { goto noproc; diff --git a/source4/lib/util.c b/source4/lib/util.c index d95924670f..93559d9518 100644 --- a/source4/lib/util.c +++ b/source4/lib/util.c @@ -410,7 +410,7 @@ uint32_t interpret_addr(const char *str) DEBUG(3,("sys_gethostbyname: host address is invalid for host %s\n",str)); return 0; } - putip((char *)&res,(char *)hp->h_addr); + memcpy((char *)&res,(char *)hp->h_addr, 4); } if (res == (uint32_t)-1) @@ -436,9 +436,7 @@ struct ipv4_addr interpret_addr2(const char *str) BOOL is_zero_ip(struct ipv4_addr ip) { - uint32_t a; - putip((char *)&a,(char *)&ip); - return(a == 0); + return ip.addr == 0; } /******************************************************************* -- cgit