]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
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 912fd86202a5548f94b21fbd03636c8d3036f0e3..de3877d4b08954739cdbcab59beb73eca73e2b15 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 8dc281a532cbc4c9f84a7def79dfd64ab0d28eea..727e05a617266268f4a75d9cd936935f5c7abdf6 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 e5a7c1bdefd34a6efa52e4ce19bdda53cb036aa8..dd51cbbfb1d61b0eff4294b2605ce83c6d18f797 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 b65210bb06c997a9c6ef2170b85c9ae5b51a7608..06c2bccba38581098e8953f6838cad3604cf1673 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 f92fe69597758eca699a6467782e18cf041ded47..52a1874ce47f6e4c9155f26382daee9ac6fca5f8 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 bd478ac2ba39991817e400e3094f087b7e47e316..5cf2f77fa74e8f85fe7249284c4f1b39e6357f80 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 9ec9d95c17a64fba5a4697d18c532214fa99cb08..e4e2c95971d96025214418481fc7904c96a31a52 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;