]> arthur.barton.de Git - netatalk.git/blobdiff - etc/afpd/nfsquota.c
/tmp/log
[netatalk.git] / etc / afpd / nfsquota.c
index 48563cc47a11100ce731b7e537a742c9d0ebb6e7..61a4b8ec435cedbf37cbd449240f8078556bec33 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: nfsquota.c,v 1.7 2002-01-19 21:29:55 jmarcus Exp $
+ * $Id: nfsquota.c,v 1.10 2002-08-29 17:22:06 jmarcus Exp $
  *
  * parts of this are lifted from the bsd quota program and are
  * therefore under the following copyright:
@@ -115,7 +115,7 @@ int getnfsquota(const struct vol *vol, const int uid, const u_int32_t bsize,
 
     /* figure out the host and path */
     if ((hostpath = strchr(vol->v_gvs, ':')) == NULL) {
-        LOG(log_error, logtype_default, "can't find hostname for %s", vol->v_gvs);
+        LOG(log_error, logtype_afpd, "can't find hostname for %s", vol->v_gvs);
         return AFPERR_PARAM;
     }
 
@@ -131,7 +131,7 @@ int getnfsquota(const struct vol *vol, const int uid, const u_int32_t bsize,
     if(callaurpc(vol, RQUOTAPROG, RQUOTAVERS, RQUOTAPROC_GETQUOTA,
                  (xdrproc_t) xdr_getquota_args, (char *) &gq_args,
                  (xdrproc_t) xdr_getquota_rslt, (char *) &gq_rslt) != 0) {
-        LOG(log_info, logtype_default, "nfsquota: can't retrieve nfs quota information. \
+        LOG(log_info, logtype_afpd, "nfsquota: can't retrieve nfs quota information. \
             make sure that rpc.rquotad is running on %s.", vol->v_gvs);
         *hostpath = ':';
         return AFPERR_PARAM;
@@ -142,21 +142,22 @@ int getnfsquota(const struct vol *vol, const int uid, const u_int32_t bsize,
         break;
 
     case Q_EPERM:
-        LOG(log_error, logtype_default, "nfsquota: quota permission error, host: %s\n",
+        LOG(log_error, logtype_afpd, "nfsquota: quota permission error, host: %s\n",
             vol->v_gvs);
         break;
 
     case Q_OK: /* we only copy the bits that we need. */
         gettimeofday(&tv, NULL);
 
-#ifdef __svr4__
+#if defined(__svr4__) || defined(TRU64)
         /* why doesn't using bsize work? */
-#define NFS_BSIZE (gq_rslt.GQR_RQUOTA.rq_bsize / DEV_BSIZE)
-#else /* __svr4__ */
+#define NFS_BSIZE gq_rslt.GQR_RQUOTA.rq_bsize / DEV_BSIZE
+#else /* __svr4__ || TRU64 */
         /* NOTE: linux' rquotad program doesn't currently report the
         * correct rq_bsize. */
-#define NFS_BSIZE (gq_rslt.GQR_RQUOTA.rq_bsize / bsize)
-#endif /* __svr4__ */
+       /* NOTE: This is integer division and can introduce rounding errors */
+#define NFS_BSIZE gq_rslt.GQR_RQUOTA.rq_bsize / bsize
+#endif /* __svr4__  || TRU64 */
 
         dqp->dqb_bhardlimit =
             gq_rslt.GQR_RQUOTA.rq_bhardlimit*NFS_BSIZE;
@@ -177,7 +178,7 @@ int getnfsquota(const struct vol *vol, const int uid, const u_int32_t bsize,
         break;
 
     default:
-        LOG(log_info, logtype_default, "bad rpc result, host: %s\n", vol->v_gvs);
+        LOG(log_info, logtype_afpd, "bad rpc result, host: %s\n", vol->v_gvs);
         break;
     }