fix dumptool on macos
authorKen Hornstein <kenh@pobox.com>
Tue, 4 May 2010 18:04:59 +0000 (14:04 -0400)
committerDerrick Brashear <shadow@dementia.org>
Mon, 12 Jul 2010 19:17:17 +0000 (12:17 -0700)
make dumptool in test suite compile on macos again

Change-Id: Id60f625ce53bc9695673b68c733fa653521a8122
Reviewed-on: http://gerrit.openafs.org/2387
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

acinclude.m4
src/tests/dumptool.c

index bf538fb..b724c50 100644 (file)
@@ -1268,6 +1268,7 @@ AC_CHECK_FUNCS(snprintf strlcat strlcpy flock getrlimit)
 AC_CHECK_FUNCS(setprogname getprogname sigaction mkstemp vsnprintf strerror strcasestr)
 AC_CHECK_FUNCS(setvbuf vsyslog getcwd)
 AC_CHECK_FUNCS(regcomp regexec regerror)
+AC_CHECK_FUNCS(fseeko64 ftello64)
 AC_MSG_CHECKING([for POSIX regex library])
 if test "$ac_cv_header_regex_h" = "yes" && \
        test "$ac_cv_func_regcomp" = "yes" && \
@@ -1297,6 +1298,7 @@ AC_CHECK_TYPE([socklen_t],[],
         [Define to int if <sys/socket.h> does not define.])],
 [#include <sys/types.h>
 #include <sys/socket.h>])
+AC_CHECK_TYPES(off64_t)
 AC_SIZEOF_TYPE(long)
 
 AC_HEADER_PAM_CONST
index affa5f9..218a2a8 100644 (file)
@@ -75,6 +75,7 @@
 #include <termios.h>
 #include <fnmatch.h>
 #include <fcntl.h>
+#include <sys/ioctl.h>
 
 #include <lock.h>
 #include <afs/afsint.h>
 
 #include <afs/dir.h>
 
+#ifndef HAVE_OFF64_T
+typedef off_t off64_t;
+#endif /* !HAVE_OFF64_T */
+#ifndef HAVE_FSEEKO64
+#define fseeko64 fseeko
+#endif /* HAVE_FSEEKO64 */
+#ifndef HAVE_FTELLO64
+#define ftello64 ftello
+#endif /* HAVE_FTELLO64 */
+
 /*
  * Sigh.  Linux blows it again
  */
@@ -1419,8 +1430,8 @@ DirListInternal(struct vnodeData *vdata, char *pathnames[], int numpathnames,
                        c = '*';
                    else
                        c = ' ';
-                   printf("%s%-*c", ep->name, longestname - strlen(ep->name),
-                          c);
+                   printf("%s%-*c", ep->name, (int)(longestname -
+                                                    strlen(ep->name)), c);
                } else
                    printf("%-*s", longestname, ep->name);
            }