From 807de8f68c0f888d1720b37cd83169928440f102 Mon Sep 17 00:00:00 2001 From: jnewman Date: Wed, 8 Nov 2000 17:12:38 +0000 Subject: [PATCH 1/1] Add force 2GB conditional at configure time. This will turn off the code in etc/afpd/unix.c that doesn't seem to work right with 64 bit file sized systems. --- acconfig.h | 1 + configure.in | 8 ++++++++ etc/afpd/unix.c | 11 +++++++++++ 3 files changed, 20 insertions(+) diff --git a/acconfig.h b/acconfig.h index a1ea4367..b21c9a97 100644 --- a/acconfig.h +++ b/acconfig.h @@ -29,3 +29,4 @@ #undef USE_FLOCK_LOCKS #undef USE_LASTDID #undef USE_PAM +#undef FORCE_2GB diff --git a/configure.in b/configure.in index 1de63ec9..4b6fb33e 100644 --- a/configure.in +++ b/configure.in @@ -184,6 +184,14 @@ AC_ARG_ENABLE(ddp, fi ) +AC_ARG_ENABLE(force2GB, + [ --enable-force2GB enable force 2GB max reported volume size], + if test "x$enableval" = "xyes"; then + AC_DEFINE(FORCE_2GB, 1) + AC_MSG_RESULT([enable forge 2GB]) + fi +) + AC_ARG_ENABLE(debug, [ --enable-debug enable debug code], if test "$enableval" != "no"; then diff --git a/etc/afpd/unix.c b/etc/afpd/unix.c index bd7be335..048dcba0 100644 --- a/etc/afpd/unix.c +++ b/etc/afpd/unix.c @@ -51,11 +51,17 @@ int ustatfs_getvolspace( vol, bfree, btotal, bsize ) *bsize = sfs.f_frsize; #endif ultrix +#if FORCE_2GB + // if the volume is over 2GB in size, report + // the size as 2GB. + // this doesn't seem to work correctly for + // 64 bit size descriptors. if ( *bfree > 0x7fffffff / *bsize ) { *bfree = 0x7fffffff; } else { *bfree *= *bsize; } +#endif #ifdef ultrix *btotal = (VolSpace) @@ -64,11 +70,16 @@ int ustatfs_getvolspace( vol, bfree, btotal, bsize ) *btotal = (VolSpace) ( sfs.f_blocks - ( sfs.f_bfree - sfs.f_bavail )) * sfs.f_frsize; #endif ultrix + +#if FORCE_2GB + // see similar block above comments if ( *bfree > 0x7fffffff / *bsize ) { *bfree = 0x7fffffff; } else { *bfree *= *bsize; } +#endif + return( AFP_OK ); } -- 2.39.2