From e6d321fcd4cbf0fdc6b153c0894f8d4c222093ad Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Tue, 28 Jul 2009 11:55:47 +0100 Subject: [PATCH] Use an anonymous pointer for lpioctl The block passed to lpioctl as cmarg is an anonymous chunk of memory, so use a type that represents it as such. Reviewed-on: http://gerrit.openafs.org/238 Tested-by: Marc Dionne Tested-by: Derrick Brashear Reviewed-by: Derrick Brashear --- src/afs/afs_syscall.c | 7 ++++--- src/kopenafs/kopenafs.c | 6 +++--- src/sys/afssyscalls.h | 2 +- src/sys/pioctl.c | 4 ++-- src/sys/rmtsysc.c | 2 +- src/sys/rmtsyss.c | 4 ++-- src/sys/sys_prototypes.h | 2 +- 7 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/afs/afs_syscall.c b/src/afs/afs_syscall.c index 912fd8620..de3877d4b 100644 --- a/src/afs/afs_syscall.c +++ b/src/afs/afs_syscall.c @@ -221,7 +221,8 @@ syscall(syscall, p1, p2, p3, p4, p5, p6) /* * lsetpag - interface to afs_setpag(). */ -lsetpag() +int +lsetpag(void) { AFS_STATCNT(lsetpag); @@ -231,8 +232,8 @@ lsetpag() /* * lpioctl - interface to pioctl() */ -lpioctl(path, cmd, cmarg, follow) - char *path, *cmarg; +int +lpioctl(char *path, int cmd, void *cmarg, int follow) { AFS_STATCNT(lpioctl); diff --git a/src/kopenafs/kopenafs.c b/src/kopenafs/kopenafs.c index 8dc281a53..727e05a61 100644 --- a/src/kopenafs/kopenafs.c +++ b/src/kopenafs/kopenafs.c @@ -51,7 +51,7 @@ k_hasafs(void) iob.in_size = 0; iob.out = NULL; iob.out_size = 0; - lpioctl(NULL, VIOCSETTOK, (char *) &iob, 0); + lpioctl(NULL, VIOCSETTOK, &iob, 0); #ifdef SIGSYS signal(SIGSYS, saved_func); @@ -73,7 +73,7 @@ k_setpag(void) int k_pioctl(char *path, int cmd, struct ViceIoctl *cmarg, int follow) { - return lpioctl(path, cmd, (char *) cmarg, follow); + return lpioctl(path, cmd, cmarg, follow); } int @@ -85,5 +85,5 @@ k_unlog(void) iob.in_size = 0; iob.out = NULL; iob.out_size = 0; - return lpioctl(NULL, VIOCUNLOG, (char *) &iob, 0); + return lpioctl(NULL, VIOCUNLOG, &iob, 0); } diff --git a/src/sys/afssyscalls.h b/src/sys/afssyscalls.h index e5a7c1bde..dd51cbbfb 100644 --- a/src/sys/afssyscalls.h +++ b/src/sys/afssyscalls.h @@ -145,7 +145,7 @@ extern char *PrintInode(); /* Declarations for lsetpag and lpioctl */ int lsetpag(void); -int lpioctl(char *path, int cmd, char *cmarg, int follow); +int lpioctl(char *path, int cmd, void *cmarg, int follow); #endif /* AFS_NT40_ENV */ diff --git a/src/sys/pioctl.c b/src/sys/pioctl.c index b65210bb0..06c2bccba 100644 --- a/src/sys/pioctl.c +++ b/src/sys/pioctl.c @@ -42,7 +42,7 @@ #pragma weak xlpioctl = lpioctl int -lpioctl(char *path, int cmd, char *cmarg, int follow) +lpioctl(char *path, int cmd, void *cmarg, int follow) { return (syscall(AFS_PIOCTL, path, cmd, cmarg, follow)); } @@ -50,7 +50,7 @@ lpioctl(char *path, int cmd, char *cmarg, int follow) #else /* AFS_SGI_ENV */ int -lpioctl(char *path, int cmd, char *cmarg, int follow) +lpioctl(char *path, int cmd, void *cmarg, int follow) { int errcode, rval; #ifndef AFS_LINUX20_ENV diff --git a/src/sys/rmtsysc.c b/src/sys/rmtsysc.c index f92fe6959..52a1874ce 100644 --- a/src/sys/rmtsysc.c +++ b/src/sys/rmtsysc.c @@ -225,7 +225,7 @@ pioctl(char *path, afs_int32 cmd, struct ViceIoctl *data, afs_int32 follow) if (!(conn = rx_connection(&errorcode, "pioctl"))) { /* Remote call can't be performed for some reason. * Try the local 'pioctl' system call ... */ - errorcode = lpioctl(path, cmd, (char *)data, follow); + errorcode = lpioctl(path, cmd, data, follow); return errorcode; } (void)SetClientCreds(&creds, groups); diff --git a/src/sys/rmtsyss.c b/src/sys/rmtsyss.c index bd478ac2b..5cf2f77fa 100644 --- a/src/sys/rmtsyss.c +++ b/src/sys/rmtsyss.c @@ -104,7 +104,7 @@ SRMTSYS_SetPag(struct rx_call *call, clientcred *creds, afs_int32 *newpag, data.out = (caddr_t) blob; data.out_size = sizeof(blob); /* force local pioctl call */ - error = lpioctl(0, _VICEIOCTL(PSetClientContext), (char *)&data, 1); + error = lpioctl(0, _VICEIOCTL(PSetClientContext), &data, 1); if (error) { if (errno == PSETPAG) { *newpag = blob[0]; /* new pag value */ @@ -143,7 +143,7 @@ SRMTSYS_Pioctl(struct rx_call *call, clientcred *creds, char *path, data.out = OutData->rmtbulk_val; data.out_size = OutData->rmtbulk_len; /* force local pioctl call */ - error = lpioctl(pathp, _VICEIOCTL(PSetClientContext), (char *)&data, follow); + error = lpioctl(pathp, _VICEIOCTL(PSetClientContext), &data, follow); if (error) { *errornumber = errno; } else { diff --git a/src/sys/sys_prototypes.h b/src/sys/sys_prototypes.h index 9ec9d95c1..e4e2c9597 100644 --- a/src/sys/sys_prototypes.h +++ b/src/sys/sys_prototypes.h @@ -19,7 +19,7 @@ extern int ioctl_afs_syscall(long, long, long, long, long, long, long, int *); #endif /* pioctl.c */ -extern int lpioctl(char *, int, char *, int); +extern int lpioctl(char *, int, void *, int); /* rmtsys.ss.c */ struct rx_call; -- 2.39.5