From ad7a5ba33399f47c781cb5b177bab1e578eaca23 Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Tue, 25 Oct 2022 16:37:41 -0500 Subject: [PATCH] FBSD: Cast afs_symlink target to char* FreeBSD commit 1493c2ee62b8cbd8dbe70670b9108b4b9c36e032 (Make vop_symlink take a const target path.) changed the 'target' argument of vop_symlink to be a 'const char*' (from 'char*'). This causes a warning: .../src/afs/FBSD/osi_vnodeops.c:1099:44: error: passing 'const char *' to parameter of type 'char *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers] afs_symlink(VTOAFS(dvp), name, ap->a_vap, ap->a_target, NULL, ^~~~~~~~~~~~ .../src/afs/afs_prototypes.h:1328:37: note: passing argument to parameter 'atargetName' here struct vattr *attrs, char *atargetName, Just cast to 'char*' explicitly to get rid of the warning. Ideally we would change afs_symlink() to accept a 'const char*', but that involves a lot of changes to cross-platform code; keep things simple for now. Change-Id: Iaa2d18a3168827c45908d44328f90425c9d1cb12 Reviewed-on: https://gerrit.openafs.org/15171 Reviewed-by: Michael Meffie Tested-by: BuildBot Reviewed-by: Andrew Deason --- src/afs/FBSD/osi_vnodeops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/afs/FBSD/osi_vnodeops.c b/src/afs/FBSD/osi_vnodeops.c index 7b20693231..e24afdc1f0 100644 --- a/src/afs/FBSD/osi_vnodeops.c +++ b/src/afs/FBSD/osi_vnodeops.c @@ -1096,7 +1096,7 @@ afs_vop_symlink(struct vop_symlink_args *ap) newvp = NULL; error = - afs_symlink(VTOAFS(dvp), name, ap->a_vap, ap->a_target, NULL, + afs_symlink(VTOAFS(dvp), name, ap->a_vap, (char*)ap->a_target, NULL, cnp->cn_cred); if (error == 0) { error = afs_lookup(VTOAFS(dvp), name, &vcp, cnp->cn_cred);