]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Windows: change thyper to offset and fix error
authorJeffrey Altman <jaltman@your-file-system.com>
Tue, 19 Apr 2011 17:17:56 +0000 (13:17 -0400)
committerJeffrey Altman <jaltman@openafs.org>
Fri, 22 Apr 2011 22:34:46 +0000 (15:34 -0700)
In cm_ReadMountPoint and cm_HandleLink the variable 'thyper'
represets the 'offset' at which cm_GetData should fetch data.
Rename 'thyper' to 'offset' and fix a coding error caused by
misinterpreting the variable purpose.

Change-Id: Icdd2493e356803b4b2bd00c7349d8d882283d29b
Reviewed-on: http://gerrit.openafs.org/4501
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-on: http://gerrit.openafs.org/4523

src/WINNT/afsd/cm_vnodeops.c

index c0e3dcc3c72e465c0723bc86122239215a37a2c5..e6323975a67969a7f0c146f79a96a93078a34398 100644 (file)
@@ -846,11 +846,11 @@ long cm_ReadMountPoint(cm_scache_t *scp, cm_user_t *userp, cm_req_t *reqp)
 #endif /* AFS_FREELANCE_CLIENT */        
     {
         char temp[MOUNTPOINTLEN];
-        osi_hyper_t thyper;
+        osi_hyper_t offset;
 
         /* otherwise, we have to read it in */
-        thyper.LowPart = thyper.HighPart = 0;
-        code = cm_GetData(scp, &thyper, temp, MOUNTPOINTLEN, userp, reqp);
+        offset.LowPart = offset.HighPart = 0;
+        code = cm_GetData(scp, &offset, temp, MOUNTPOINTLEN, userp, reqp);
         if (code)
             return code;
 
@@ -865,8 +865,8 @@ long cm_ReadMountPoint(cm_scache_t *scp, cm_user_t *userp, cm_req_t *reqp)
             return CM_ERROR_INVAL;
 
         /* convert the terminating dot to a NUL */
-        temp[thyper.LowPart - 1] = 0;
-        memcpy(scp->mountPointStringp, temp, thyper.LowPart);
+        temp[scp->length.LowPart - 1] = 0;
+        memcpy(scp->mountPointStringp, temp, scp->length.LowPart);
     }
 
     return code;
@@ -1723,11 +1723,11 @@ long cm_HandleLink(cm_scache_t *linkScp, cm_user_t *userp, cm_req_t *reqp)
 #endif /* AFS_FREELANCE_CLIENT */        
         {
             char temp[MOUNTPOINTLEN];
-            osi_hyper_t thyper;
+            osi_hyper_t offset;
 
             /* read the link data from the file server */
-            thyper.LowPart = thyper.HighPart = 0;
-            code = cm_GetData(linkScp, &thyper, temp, MOUNTPOINTLEN, userp, reqp);
+            offset.LowPart = offset.HighPart = 0;
+            code = cm_GetData(linkScp, &offset, temp, MOUNTPOINTLEN, userp, reqp);
             if (code)
                 return code;
 
@@ -1741,9 +1741,9 @@ long cm_HandleLink(cm_scache_t *linkScp, cm_user_t *userp, cm_req_t *reqp)
             if (linkScp->length.LowPart == 0)
                 return CM_ERROR_INVAL;
 
-            /* convert the terminating dot to a NUL */
-            temp[thyper.LowPart - 1] = 0;
-            memcpy(linkScp->mountPointStringp, temp, thyper.LowPart);
+            /* make sure we are NUL terminated */
+            temp[linkScp->length.LowPart] = 0;
+            memcpy(linkScp->mountPointStringp, temp, linkScp->length.LowPart + 1);
         }
         
         if ( !strnicmp(linkScp->mountPointStringp, "msdfs:", strlen("msdfs:")) )