]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Provide rpl_malloc() for sntp for systems that need it
authorHarlan Stenn <stenn@ntp.org>
Thu, 20 Nov 2008 07:09:48 +0000 (07:09 +0000)
committerHarlan Stenn <stenn@ntp.org>
Thu, 20 Nov 2008 07:09:48 +0000 (07:09 +0000)
bk: 49250d3c2ACw1PSeYDTxDS3ZVupnRg

ChangeLog
gsoc_sntp/main.c
gsoc_sntp/networking.c

index a47b2fda8efd4137a447f3bd9f81a48d020d2e6a..5083e6e1bdc03b3bf38838dddbc284bd416a59f2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,4 @@
+* Provide rpl_malloc() for sntp for systems that need it.
 * Handle ss_len and socklen type for sntp.
 * Fixes to the sntp configure.ac script.
 * Provide INET6_ADDRSTRLEN if it is missing.
index c3e03abbf242872a451e9d09180c2db695095336..355c03423dabd35e7444da1d7b004bd882a0819e 100644 (file)
@@ -27,6 +27,16 @@ int on_wire (struct addrinfo *host);
 int set_time (double offset);
 
 
+#if !HAVE_MALLOC
+void *
+rpl_malloc (size_t n)
+{
+       if (n == 0)
+           n = 1;
+       return malloc (n);
+}
+#endif /* !HAVE_MALLOC */
+
 int 
 main (
                int argc,
index ee149f98e6a6b1a30ac1de4e80a9d1c38495bf5b..a4472df1a7b85db8b929e885fec0dc551429da5a 100644 (file)
@@ -202,7 +202,7 @@ recvdata (
                int rdata_length
         )
 {
-       socklen_t slen = SOCKLEN(&rsock);
+       GETSOCKNAME_SOCKLEN_TYPE slen = SOCKLEN(&rsock);
 
 #ifdef DEBUG
        printf("sntp recvdata: Trying to receive data from...\n");
@@ -367,9 +367,9 @@ recv_bcst_data (
                        break;
 
 /*             default: */
-                       socklen_t ss_len = SOCKLEN(ras);
+                       GETSOCKNAME_SOCKLEN_TYPE ss_len = SOCKLEN(ras);
 
-                       recv_bytes = recvfrom(rsock, rdata, rdata_len, 0, (struct sockaddr *) ras, (socklen_t *) &ss_len);
+                       recv_bytes = recvfrom(rsock, rdata, rdata_len, 0, (struct sockaddr *) ras, (GETSOCKNAME_SOCKLEN_TYPE *) &ss_len);
        }
 
        if(recv_bytes == -1) {