From 0467802384c0c8bfa735e6378a9b5326048c7e05 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Thu, 15 Dec 2011 03:28:34 -0500 Subject: [PATCH] vol: fix a08c3207255756c825ab69a19e04f79dd879c646 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 Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman (cherry picked from commit 37a0c3d00a6e2d072faf7c2958ef0c7224add161) Change-Id: I34963c4e941ee3d580494a87b244c67bc3806ac7 Reviewed-on: http://gerrit.openafs.org/11268 Tested-by: Andrew Deason Reviewed-by: Andrew Deason Reviewed-by: Stephan Wiesand --- src/vol/vol-info.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/vol/vol-info.c b/src/vol/vol-info.c index 2e2f7eaa7..018907cf0 100644 --- a/src/vol/vol-info.c +++ b/src/vol/vol-info.c @@ -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; } -- 2.39.5