summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1998-10-30 02:50:02 +0000
committerAndrew Tridgell <tridge@samba.org>1998-10-30 02:50:02 +0000
commit7b3d425783f68e3784ac25af60ed9407a2ae9a18 (patch)
tree426afa20ffad685a34fa9a30578ed73cfb124ae8 /lib
parentb24203b323c86e250054bff19274b1f466303712 (diff)
downloadrsync-7b3d425783f68e3784ac25af60ed9407a2ae9a18.tar.gz
check for a broken inet_ntoa() on IRIX
Diffstat (limited to 'lib')
-rw-r--r--lib/compat.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/compat.c b/lib/compat.c
index cabdc871..f47275f5 100644
--- a/lib/compat.c
+++ b/lib/compat.c
@@ -76,3 +76,19 @@ char *strpbrk(const char *s, const char *accept)
return NULL;
}
#endif
+
+#ifdef REPLACE_INET_NTOA
+char *rep_inet_ntoa(struct in_addr ip)
+{
+ unsigned char *p = (unsigned char *)&ip.s_addr;
+ static char buf[18];
+#if WORDS_BIGENDIAN
+ slprintf(buf, 17, "%d.%d.%d.%d",
+ (int)p[0], (int)p[1], (int)p[2], (int)p[3]);
+#else
+ slprintf(buf, 17, "%d.%d.%d.%d",
+ (int)p[3], (int)p[2], (int)p[1], (int)p[0]);
+#endif
+ return buf;
+}
+#endif