]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
vol: fix a08c3207255756c825ab69a19e04f79dd879c646
authorJeffrey Altman <jaltman@your-file-system.com>
Thu, 15 Dec 2011 08:28:34 +0000 (03:28 -0500)
committerStephan Wiesand <stephan.wiesand@desy.de>
Wed, 13 Aug 2014 18:32:06 +0000 (14:32 -0400)
Patchset a08c3207255756c825ab69a19e04f79dd879c646 broke the suse
and windows builds by relying on C99 language syntax.  Fix it.

Reviewed-on: http://gerrit.openafs.org/6337
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit 37a0c3d00a6e2d072faf7c2958ef0c7224add161)

Change-Id: I34963c4e941ee3d580494a87b244c67bc3806ac7
Reviewed-on: http://gerrit.openafs.org/11268
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/vol/vol-info.c

index 2e2f7eaa77e17e90440eca45b9216cd32adb830a..018907cf0ee5bcb2a4da7a1b6db4ebc4c95da5ed 100644 (file)
@@ -1498,7 +1498,7 @@ main(int argc, char **argv)
     base = strrchr(argv[0], '/');
 #ifdef AFS_NT40_ENV
     if (!base) {
-       base = strrchr(pathname, '\\');
+       base = strrchr(argv[0], '\\');
     }
 #endif /* AFS_NT40_ENV */
     if (!base) {
@@ -1836,7 +1836,7 @@ GetDirEntry(Volume * vp, VnodeDiskObject * pvnode, VnodeId cvnid,
 int
 LookupPath(struct VnodeDetails *vdp)
 {
-    const int MAX_PATH_LEN = 1023;
+#define MAX_PATH_LEN 1023
     static char path_buffer[MAX_PATH_LEN + 1];
     static char dirent[MAX_PATH_LEN + 1];
     char vnode_buffer[SIZEOF_LARGEDISKVNODE];
@@ -1886,11 +1886,11 @@ LookupPath(struct VnodeDetails *vdp)
 
        if (space < (len + 1)) {
            fprintf(stderr,
-                   "%s: Failed to lookup path for fid %lu.%lu.%lu: path exceeds max length (%d).\n",
+                   "%s: Failed to lookup path for fid %lu.%lu.%lu: path exceeds max length (%u).\n",
                    progname, afs_printable_uint32_lu(V_id(vdp->vp)),
                    afs_printable_uint32_lu(vdp->vnodeNumber),
                    afs_printable_uint32_lu(vdp->vnode->uniquifier),
-                   sizeof(path_buffer) - 1);
+                   MAX_PATH_LEN);
            cursor = NULL;
            code = -1;
            break;
@@ -1926,7 +1926,7 @@ LookupPath(struct VnodeDetails *vdp)
 static int
 ReadSymlinkTarget(struct VnodeDetails *vdp)
 {
-    const int MAX_SYMLINK_LEN = 1023;
+#define MAX_SYMLINK_LEN 1023
     static char buffer[MAX_SYMLINK_LEN + 1];
     int code;
     Volume *vp = vdp->vp;
@@ -1948,7 +1948,8 @@ ReadSymlinkTarget(struct VnodeDetails *vdp)
                afs_printable_uint32_lu(V_id(vp)),
                afs_printable_uint32_lu(vnodeNumber),
                afs_printable_uint32_lu(vnode->uniquifier),
-               afs_printable_uint32_lu(vnode->dataVersion), MAX_SYMLINK_LEN,
+               afs_printable_uint32_lu(vnode->dataVersion),
+                MAX_SYMLINK_LEN,
                fileLength);
        return -1;
     }