fix implicit decl warnings
authorMike Frysinger <vapier@gentoo.org>
Tue, 4 Dec 2012 03:30:04 +0000 (22:30 -0500)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Mon, 11 Aug 2014 13:08:05 +0000 (06:08 -0700)
Include the proper headers to fix warnings like:
libnfs-sync.c:1529:3: warning: implicit declaration of function 'gettimeofday' [-Wimplicit-function-declaration]
libnfs-zdr.c:506:2: warning: implicit declaration of function 'getuid' [-Wimplicit-function-declaration]

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
sys/time.h needs to be protected with an ifdef

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
lib/libnfs-sync.c
lib/libnfs-zdr.c
lib/libnfs.c
lib/socket.c

index 0fc10944f86e6572d13998958887721283b18dad..2851a9109f4aeb625c6f171e8fd9a71afc446bc7 100644 (file)
 #include <sys/sockio.h>
 #endif
 
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
 #include "libnfs-zdr.h"
 #include "libnfs.h"
 #include "libnfs-raw.h"
index c32f661fc86cc8170940673e4b10c3d4deebce2d..b6b3ed984bfc35edcf2ed3e0be693861cf88500b 100644 (file)
  * i.e. zdrmem_create() buffers.
  * It aims to be compatible with normal rpcgen generated functions.
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #ifdef WIN32
 #include "win32_compat.h"
 #endif
 #include "aros_compat.h"
 #endif
 
+#ifdef HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+
 #include <stdlib.h>
 #include <string.h>
 #include <time.h>
+#include <unistd.h>
 #include "libnfs-zdr.h"
 
 struct opaque_auth _null_auth;
index 87106bb0c6c7d0cb5dbaa6cecf7d9541f9f3dcdb..f87752cdd2766d378f2992ec85b203e1a9871e53 100644 (file)
@@ -73,6 +73,7 @@
 #include <string.h>
 #include <assert.h>
 #include <errno.h>
+#include <time.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
index 3f7f89f90c9a368dc5ff6c48c0ab87f790d4e096..f8db957e0bb600510fcba27afc06dd04b2145c1b 100644 (file)
@@ -68,6 +68,7 @@
 #include <fcntl.h>
 #include <string.h>
 #include <errno.h>
+#include <time.h>
 #include <sys/types.h>
 #include "libnfs-zdr.h"
 #include "libnfs.h"