Remove duplicate CREATE_SGUID_ADMIN_ONLY define
[openafs.git] / src / viced / afsfileprocs.c
index f178a96..b05ff1a 100644 (file)
@@ -76,6 +76,7 @@
 #include <afs/opr.h>
 #include <rx/rx_queue.h>
 #include <opr/lock.h>
+#include <opr/proc.h>
 #include <afs/nfs.h>
 #include <afs/afsint.h>
 #include <afs/vldbint.h>
@@ -371,7 +372,7 @@ CallPreamble(struct rx_call *acall, int activecall, struct AFSFid *Fid,
     tclient = h_FindClient_r(*tconn, &viceid);
     if (!tclient) {
        H_UNLOCK;
-       LogClientError("Client host too busy", *tconn, viceid, Fid);
+       LogClientError("CallPreamble: Couldn't get client", *tconn, viceid, Fid);
        return VBUSY;
     }
     thost = tclient->host;
@@ -380,7 +381,7 @@ CallPreamble(struct rx_call *acall, int activecall, struct AFSFid *Fid,
            h_ReleaseClient_r(tclient);
            h_Release_r(thost);
            H_UNLOCK;
-           LogClientError("Cannot get CPS for client", *tconn, viceid, Fid);
+           LogClientError("CallPreamble: Couldn't get CPS", *tconn, viceid, Fid);
            return -1001;
        }
        retry_flag = 0;         /* Retry once */
@@ -407,7 +408,7 @@ CallPreamble(struct rx_call *acall, int activecall, struct AFSFid *Fid,
            h_ReleaseClient_r(tclient);
            h_Release_r(thost);
            H_UNLOCK;
-           LogClientError("Cannot reconnect to ptserver", *tconn, viceid, Fid);
+           LogClientError("CallPreamble: couldn't reconnect to ptserver", *tconn, viceid, Fid);
            return -1001;
        }
 
@@ -1765,7 +1766,6 @@ Update_TargetVnodeStatus(Vnode * targetptr, afs_uint32 Caller,
     }
     if (InStatus->Mask & AFS_SETMODE) {
        int modebits = InStatus->UnixModeBits;
-#define        CREATE_SGUID_ADMIN_ONLY 1
 #ifdef CREATE_SGUID_ADMIN_ONLY
        if (!remote && VanillaUser(client))
            modebits = modebits & 0777;
@@ -5039,11 +5039,7 @@ SetAFSStats(struct AFSStatistics *stats)
     if (seconds <= 0)
        seconds = 1;
     stats->StoreDataRate = AFSCallStats.TotalStoredBytes / seconds;
-#ifdef AFS_NT40_ENV
-    stats->ProcessSize = -1;   /* TODO: */
-#else
-    stats->ProcessSize = (afs_int32) ((long)sbrk(0) >> 10);
-#endif
+    stats->ProcessSize = opr_procsize();
     FS_UNLOCK;
     h_GetWorkStats((int *)&(stats->WorkStations),
                   (int *)&(stats->ActiveWorkStations), (int *)0,
@@ -5125,6 +5121,11 @@ SRXAFS_GetStatistics64(struct rx_call *acall, afs_int32 statsVersion, ViceStatis
     if ((code = CallPreamble(acall, NOTACTIVECALL, NULL, &tcon, &thost)))
        goto Bad_GetStatistics64;
 
+    if (statsVersion != STATS64_VERSION) {
+       code = EINVAL;
+       goto Bad_GetStatistics64;
+    }
+
     ViceLog(1, ("SAFS_GetStatistics64 Received\n"));
     Statistics->ViceStatistics64_val =
        malloc(statsVersion*sizeof(afs_uint64));
@@ -5160,12 +5161,7 @@ SRXAFS_GetStatistics64(struct rx_call *acall, afs_int32 statsVersion, ViceStatis
         seconds = 1;
     Statistics->ViceStatistics64_val[STATS64_STOREDATARATE] =
        AFSCallStats.TotalStoredBytes / seconds;
-#ifdef AFS_NT40_ENV
-    Statistics->ViceStatistics64_val[STATS64_PROCESSSIZE] = -1;
-#else
-    Statistics->ViceStatistics64_val[STATS64_PROCESSSIZE] =
-       (afs_int32) ((long)sbrk(0) >> 10);
-#endif
+    Statistics->ViceStatistics64_val[STATS64_PROCESSSIZE] = opr_procsize();
     FS_UNLOCK;
     h_GetWorkStats64(&(Statistics->ViceStatistics64_val[STATS64_WORKSTATIONS]),
                      &(Statistics->ViceStatistics64_val[STATS64_ACTIVEWORKSTATIONS]),