(malloc): Undef before defining, since stdlib.h may have defined it.
[gnulib.git] / lib / readutmp.c
index 1c680f0..29b24a5 100644 (file)
@@ -21,6 +21,7 @@
 
 #include <stdio.h>
 
+#include <sys/types.h>
 #include <sys/stat.h>
 #if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
 # include <string.h>
@@ -57,7 +58,7 @@ extract_trimmed_name (const STRUCT_UTMP *ut)
    the number of entries, and return zero.  If there is any error,
    return non-zero and don't modify the parameters.  */
 
-#if HAVE_UTMPNAME
+#ifdef UTMP_NAME_FUNCTION
 
 int
 read_utmp (const char *filename, int *n_entries, STRUCT_UTMP **utmp_buf)
@@ -129,4 +130,4 @@ read_utmp (const char *filename, int *n_entries, STRUCT_UTMP **utmp_buf)
   return 0;
 }
 
-#endif /* HAVE_UTMPNAME */
+#endif