lwp-fix-protoize-20080418
[openafs.git] / src / butc / tcudbprocs.c
index fd5687f..c0070a9 100644 (file)
@@ -28,6 +28,7 @@ RCSID
 #include <rx/rx.h>
 #include <afs/afsint.h>
 #include <stdio.h>
+#include <string.h>
 #include <afs/procmgmt.h>
 #include <afs/assert.h>
 #include <afs/prs_fs.h>
@@ -35,7 +36,6 @@ RCSID
 #include <afs/nfs.h>
 #include <lwp.h>
 #include <lock.h>
-#include <afs/auth.h>
 #include <afs/cellconfig.h>
 #include <afs/keys.h>
 #include <ubik.h>
@@ -52,6 +52,11 @@ RCSID
 extern int dump_namecheck;
 extern int autoQuery;
 
+static void initTapeBuffering();
+static writeDbDump();
+static restoreDbEntries();
+
+void * KeepAlive(void *);
 /* CreateDBDump
  *      create a dump entry for a saved database 
  */
@@ -409,8 +414,6 @@ writeDbDump(tapeInfoPtr, taskId, expires, dumpid)
     extern struct tapeConfig globalTapeConfig;
     extern struct udbHandleS udbHandle;
 
-    extern int KeepAlive();
-
     blockSize = BUTM_BLKSIZE;
     writeBlock = (char *)malloc(BUTM_BLOCKSIZE);
     if (!writeBlock)
@@ -620,10 +623,10 @@ writeDbDump(tapeInfoPtr, taskId, expires, dumpid)
  *     dump backup database to tape
  */
 
-afs_int32
-saveDbToTape(saveDbIfPtr)
-     struct saveDbIf *saveDbIfPtr;
+void *
+saveDbToTape(void *param)
 {
+    struct saveDbIf *saveDbIfPtr = (struct saveDbIf *)param;
     afs_int32 code = 0;
     afs_int32 i;
     int wroteLabel;
@@ -741,7 +744,7 @@ saveDbToTape(saveDbIfPtr)
 
     free(saveDbIfPtr);
     LeaveDeviceQueue(deviceLatch);
-    return (code);
+    return (void *)(code);
 }
 
 struct rstTapeInfo {
@@ -905,7 +908,7 @@ readDbTape(tapeInfoPtr, rstTapeInfoPtr, query)
 }
 
 static afs_int32 nbytes = 0;   /* # bytes left in buffer */
-static
+static void
 initTapeBuffering()
 {
     nbytes = 0;
@@ -1014,10 +1017,10 @@ restoreDbEntries(tapeInfoPtr, rstTapeInfoPtr)
  *     restore the backup database from tape.
  */
 
-afs_int32
-restoreDbFromTape(taskId)
-     afs_uint32 taskId;
+void *
+restoreDbFromTape(void *param)
 {
+    afs_uint32 taskId = (afs_uint32) param;
     afs_int32 code = 0;
     afs_int32 i;
     struct butm_tapeInfo tapeInfo;
@@ -1103,7 +1106,7 @@ restoreDbFromTape(taskId)
     LeaveDeviceQueue(deviceLatch);
     setStatus(taskId, TASK_DONE);
 
-    return (code);
+    return (void *)(code);
 }
 
 /* KeepAlive
@@ -1115,8 +1118,8 @@ restoreDbFromTape(taskId)
  *      
  *      Use the same udbHandle as writeDbDump so we go to the same server.
  */
-int
-KeepAlive()
+void *
+KeepAlive(void *unused)
 {
     charListT charList;
     afs_int32 code;
@@ -1168,7 +1171,7 @@ restoreDbHeader(tapeInfo, rstTapeInfoPtr, nextHeader)
 
     /* Add the database header to the database */
     code =
-       ubik_Call(BUDB_RestoreDbHeader, udbHandle.uh_client, 0,
+       ubik_BUDB_RestoreDbHeader(udbHandle.uh_client, 0,
                  &hostDbHeader);
     if (code) {
        ErrorLog(0, rstTapeInfoPtr->taskId, code, 0,