sys: Tidy up header includes
[openafs.git] / src / sys / rmtsyss.c
index 2cb68a9..655b0e5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Copyright 2000, International Business Machines Corporation and others.
  * All Rights Reserved.
- * 
+ *
  * This software has been released under the terms of the IBM Public
  * License.  For details, see the LICENSE file in the top-level source
  * directory or online at http://www.openafs.org/dl/license10.html
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID
-    ("$Header$");
+#include <roken.h>
 
-#include <sys/types.h>
-#include <sys/ioctl.h>
 #include <afs/vice.h>
-#include <netdb.h>
-#include <netinet/in.h>
-#include <sys/stat.h>
-#include <sys/file.h>
-#include <stdio.h>
-#include <errno.h>
 #include <rx/xdr.h>
-#include <errno.h>
-#include <signal.h>
-#include <string.h>
+
 /*#include <afs/cellconfig.h>*/
 #include "rmtsys.h"
-
-extern RMTSYS_ExecuteRequest();
+#include "sys_prototypes.h"
 
 #define        NFS_EXPORTER        1   /* To probably handle more later */
 #define        PSETPAG             110 /* Also defined in afs/afs_pioctl.c */
@@ -55,15 +43,16 @@ extern RMTSYS_ExecuteRequest();
 /* Main routine of the remote AFS system call server. The calling process will
  * never return; this is currently called from afsd (when "-rmtsys" is passed
  * as a parameter) */
-rmtsysd()
+void
+rmtsysd(void)
 {
 /*  void catchsig(int); */
     struct rx_securityClass *(securityObjects[N_SECURITY_OBJECTS]);
     struct rx_service *service;
 
-    /* 
+    /*
      * Ignore SIGHUP signal since apparently is sent to the processes that
-     * start up from /etc/rc for some systems like hpux and aix3.1... 
+     * start up from /etc/rc for some systems like hpux and aix3.1...
      */
     signal(SIGHUP, SIG_IGN);
 
@@ -77,13 +66,12 @@ rmtsysd()
        rx_NewService(0, RMTSYS_SERVICEID, AFSCONF_RMTSYSSERVICE,
                      securityObjects, N_SECURITY_OBJECTS,
                      RMTSYS_ExecuteRequest);
-    if (service == (struct rx_service *)0)
+    if (service == NULL)
        rmt_Quit("rx_NewService");
     /* One may wish to tune some default RX params for better performance
      * at some point... */
     rx_SetMaxProcs(service, 2);
     rx_StartServer(1);         /* Donate this process to the server process pool */
-    return 0; /* not reached */
 }
 
 
@@ -91,14 +79,12 @@ rmtsysd()
  * here we also get back the new pag value; we need this so that the caller
  * can add it to its group list via setgroups() */
 afs_int32
-SRMTSYS_SetPag(call, creds, newpag, errornumber)
-     struct rx_call *call;
-     clientcred *creds;
-     afs_int32 *newpag, *errornumber;
+SRMTSYS_SetPag(struct rx_call *call, clientcred *creds, afs_int32 *newpag,
+              afs_int32 *errornumber)
 {
     afs_uint32 blob[PIOCTL_HEADER];
     struct ViceIoctl data;
-    register afs_int32 error;
+    afs_int32 error;
 
     *errornumber = 0;
     SETCLIENTCONTEXT(blob, rx_HostOf(call->conn->peer), creds->uid,
@@ -121,14 +107,11 @@ SRMTSYS_SetPag(call, creds, newpag, errornumber)
 
 /* Implements the remote pioctl(2) call */
 afs_int32
-SRMTSYS_Pioctl(call, creds, path, cmd, follow, InData, OutData, errornumber)
-     struct rx_call *call;
-     clientcred *creds;
-     afs_int32 cmd, follow, *errornumber;
-     char *path;
-     rmtbulk *InData, *OutData;
+SRMTSYS_Pioctl(struct rx_call *call, clientcred *creds, char *path,
+              afs_int32 cmd, afs_int32 follow, rmtbulk *InData,
+              rmtbulk *OutData, afs_int32 *errornumber)
 {
-    register afs_int32 error;
+    afs_int32 error;
     struct ViceIoctl data;
     char *pathp = path;
     afs_uint32 blob[PIOCTL_HEADER];
@@ -165,9 +148,13 @@ SRMTSYS_Pioctl(call, creds, path, cmd, follow, InData, OutData, errornumber)
     return (0);
 }
 
-rmt_Quit(msg, a, b)
-     char *msg;
+void
+rmt_Quit(char *msg, ...)
 {
-    fprintf(stderr, msg, a, b);
+    va_list ap;
+
+    va_start(ap, msg);
+    vfprintf(stderr, msg, ap);
+    va_end(ap);
     exit(1);
 }