$NetBSD: patch-as,v 1.3 2004/09/10 10:42:00 agc Exp $

--- yatd/dfree.c.orig	2001-07-09 12:32:52.000000000 +0900
+++ yatd/dfree.c
@@ -72,12 +72,6 @@
 
 #define DEBUG_LOCAL
 
-#ifndef LONGLONG_OPTC 
-/* LONGLONG_OPTCƤʤˤ ơ
-   ƥθҤȤƻȤ */
-#define LONGLONG_OPTC /* */
-#endif
-
 int DFreeCheck(pPath, pSizFree, pNodFree)
      char   * pPath;    /* 桼Υۡǥ쥯ȥΰ */
      OFF_T  * pSizFree; /* ֥å */
@@ -99,7 +93,7 @@
   nodLimit = *pNodFree; /* ߥåȤΥΡɿꤹ */
 
 #ifdef DEBUG_LOCAL
-  LogDEBUG("sizLimit:%" LONGLONG_OPTC  "d, nodLimit:%d, sizof(OFF_T):%d", 
+  LogDEBUG("sizLimit:%" LONGLONG_OPTC  "d, nodLimit:%ld, sizof(OFF_T):%d", 
 	   sizLimit, nodLimit, sizeof (OFF_T));
 #endif /* DEBUG_LOCAL */
 
@@ -122,23 +116,30 @@
 #ifdef DEBUG_LOCAL
 # ifdef BSD44 
   LogDEBUG("statfs() returns:");
+#  ifdef HAVE_STATVFS
+  LogDEBUG("  flags: 0x%lx", statfsBuf.f_flag);
+#  else
   LogDEBUG("  type: %d", statfsBuf.f_type);
-  LogDEBUG("  flags: 0x%x", statfsBuf.f_flags);
-#  ifdef __NetBSD__
+  LogDEBUG("  flags: 0x%lx", statfsBuf.f_flags);
+#   ifdef __NetBSD__
   LogDEBUG("  oflags: 0x%x", statfsBuf.f_oflags);
-#  endif
+#   endif /* __NetBSD__ */
+#  endif /* HAVE_STATVFS */
 #  ifdef BSDOS1
   LogDEBUG("  fsize: %d", statfsBuf.f_fsize);
 #  endif
-  LogDEBUG("  bsize: %d", statfsBuf.f_bsize);
-  LogDEBUG("  iosize: %d", statfsBuf.f_iosize);
-  LogDEBUG("  blocks: %d", statfsBuf.f_blocks);
-  LogDEBUG("  bfree: %d", statfsBuf.f_bfree);
-  LogDEBUG("  bavail: %d", statfsBuf.f_bavail);
-  LogDEBUG("  files: %d", statfsBuf.f_files);
-  LogDEBUG("  ffree: %d", statfsBuf.f_ffree);
-  LogDEBUG("  fsid: %d", statfsBuf.f_fsid);
-  LogDEBUG("  owner %d", statfsBuf.f_owner);
+  LogDEBUG("  bsize: %ld", statfsBuf.f_bsize);
+  LogDEBUG("  iosize: %ld", statfsBuf.f_iosize);
+  LogDEBUG("  blocks: %ld", statfsBuf.f_blocks);
+  LogDEBUG("  bfree: %ld", statfsBuf.f_bfree);
+  LogDEBUG("  bavail: %ld", statfsBuf.f_bavail);
+  LogDEBUG("  files: %ld", statfsBuf.f_files);
+  LogDEBUG("  ffree: %ld", statfsBuf.f_ffree);
+#  ifdef HAVE_STATVFS
+  LogDEBUG("  fsid: %d-%d", statfsBuf.f_fsidx.__fsid_val[0], statfsBuf.f_fsidx.__fsid_val[1]);
+#  else
+  LogDEBUG("  fsid: %d-%d", statfsBuf.f_fsid.val[0], statfsBuf.f_fsid.val[1]);
+#  endif /* HAVE_STATVFS */
 #ifdef STRUCT_STATFS_HAVE_F_FSTYPENAME
   LogDEBUG("  fstypename: %.256s", statfsBuf.f_fstypename);
 #endif
@@ -311,7 +312,7 @@
   nodFree = SysData.nodLimitFree;
 
 #ifdef DEBUG_LOCAL
-    LogDEBUG("FuncDFree(): sizFree:%" LONGLONG_OPTC "d, nodFree:%d",
+    LogDEBUG("FuncDFree(): sizFree:%" LONGLONG_OPTC "d, nodFree:%ld",
 	     sizFree, nodFree);
 #endif
     
@@ -325,7 +326,7 @@
     if (DFreeCheck(SysData.szUserFldrDir, &sizFree, &nodFree)){
       return FAILURE;
     }
-    Msg2Cli(SUCCESS, "%" LONGLONG_OPTC "d %d", sizFree, nodFree);
+    Msg2Cli(SUCCESS, "%" LONGLONG_OPTC "d %ld", sizFree, nodFree);
 #endif /* DONT_CHECKDFREE */
   return SUCCESS;
 }
@@ -427,7 +428,7 @@
 
 #ifdef STRUCT_DQBLK_CURRENT_FILES
   retval = (quota_size_t)quota_block->dqb_curfiles;
-#endif STRUCT_DQBLK_CURRENT_FILES
+#endif /* STRUCT_DQBLK_CURRENT_FILES */
 
   return retval;
 }
@@ -449,12 +450,12 @@
   switch( status ){
   case SUCCESS:
     LogDEBUG("quotactl() returns:");
-    LogDEBUG(" bhardlimit: %d",quota_get_block_hard_limit(quota_block));
-    LogDEBUG(" bsoftlimit: %d",quota_get_block_soft_limit(quota_block));
-    LogDEBUG(" curblocks : %d",quota_get_block_current(quota_block));
-    LogDEBUG(" ihardlimit: %d",quota_get_inode_hard_limit(quota_block));
-    LogDEBUG(" isoftlimit: %d",quota_get_inode_soft_limit(quota_block));
-    LogDEBUG(" curinodes : %d", quota_get_inode_current(quota_block));
+    LogDEBUG(" bhardlimit: %ld",quota_get_block_hard_limit(quota_block));
+    LogDEBUG(" bsoftlimit: %ld",quota_get_block_soft_limit(quota_block));
+    LogDEBUG(" curblocks : %ld",quota_get_block_current(quota_block));
+    LogDEBUG(" ihardlimit: %ld",quota_get_inode_hard_limit(quota_block));
+    LogDEBUG(" isoftlimit: %ld",quota_get_inode_soft_limit(quota_block));
+    LogDEBUG(" curinodes : %ld", quota_get_inode_current(quota_block));
     return SUCCESS;
   case FAILURE:
     return FAILURE;
