Use an anonymous pointer for lpioctl
authorSimon Wilkinson <sxw@inf.ed.ac.uk>
Tue, 28 Jul 2009 10:55:47 +0000 (11:55 +0100)
committerDerrick Brashear <shadow@dementia.org>
Tue, 28 Jul 2009 14:24:10 +0000 (07:24 -0700)
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 <marc.c.dionne@gmail.com>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

src/afs/afs_syscall.c
src/kopenafs/kopenafs.c
src/sys/afssyscalls.h
src/sys/pioctl.c
src/sys/rmtsysc.c
src/sys/rmtsyss.c
src/sys/sys_prototypes.h

index 912fd86..de3877d 100644 (file)
@@ -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);
index 8dc281a..727e05a 100644 (file)
@@ -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);
 }
index e5a7c1b..dd51cbb 100644 (file)
@@ -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 */
 
index b65210b..06c2bcc 100644 (file)
@@ -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
index f92fe69..52a1874 100644 (file)
@@ -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);
index bd478ac..5cf2f77 100644 (file)
@@ -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 {
index 9ec9d95..e4e2c95 100644 (file)
@@ -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;