# pragma GCC diagnostic warning "-Wimplicit-function-declaration"
#endif
-#include <rx/xdr.h>
+#include <afs/opr.h>
#include <rx/rx.h>
#include <afs/afsint.h>
-#include <afs/afs_assert.h>
#include <afs/prs_fs.h>
#include <afs/nfs.h>
#include <lwp.h>
*wroteLabel = 1;
/* Initialize a tapeEntry for later inclusion into the database */
- listEntryPtr =
- (struct tapeEntryList *)malloc(sizeof(struct tapeEntryList));
+ listEntryPtr = calloc(1, sizeof(struct tapeEntryList));
if (!listEntryPtr)
ERROR_EXIT(TC_NOMEMORY);
- memset(listEntryPtr, 0, sizeof(struct tapeEntryList));
/* Remember dumpid so we can delete it later */
if ((oldTapeLabel.structVersion >= TAPE_VERSION_3)
extern struct tapeConfig globalTapeConfig;
extern struct udbHandleS udbHandle;
+ charList.charListT_val = 0;
+ charList.charListT_len = 0;
blockSize = BUTM_BLKSIZE;
- writeBlock = (char *)malloc(BUTM_BLOCKSIZE);
+ writeBlock = malloc(BUTM_BLOCKSIZE);
if (!writeBlock)
ERROR_EXIT(TC_NOMEMORY);
writeBufPtr = &writeBuffer[0];
firstcall = 1;
sequence = 1;
- charList.charListT_val = 0;
- charList.charListT_len = 0;
while (1) { /*w */
/* When no data in buffer, read data from the budb_server */
AFS_SIGSET_RESTORE();
#else
code =
- LWP_CreateProcess(KeepAlive, 16384, 1, (void *)NULL,
+ LWP_CreateProcess(KeepAlive, 16384, 1, NULL,
"Keep-alive process", &alivePid);
#endif
- /* XXX should we check code here ??? XXX */
+ if (code) {
+ ErrorLog(0, taskId, code, 0,
+ "Failed to create keep alive process\n");
+ ERROR_EXIT(code);
+ }
}
firstcall = 0;
saveDbToTape(void *param)
{
struct saveDbIf *saveDbIfPtr = (struct saveDbIf *)param;
- afs_int32 code = 0;
+ afs_int32 code;
afs_int32 i;
int wroteLabel;
afs_uint32 taskId;
afs_pthread_setname_self("Db save");
expires = (saveDbIfPtr->archiveTime ? NEVERDATE : 0);
taskId = saveDbIfPtr->taskId;
+ dumpEntry.id = 0;
setStatus(taskId, DRIVE_WAIT);
EnterDeviceQueue(deviceLatch); /* lock tape device */
/* Initialize a tapeEntry for later inclusion into the database */
- listEntryPtr =
- (struct tapeEntryList *)malloc(sizeof(struct tapeEntryList));
+ listEntryPtr = calloc(1, sizeof(struct tapeEntryList));
if (!listEntryPtr)
ERROR_EXIT(TC_NOMEMORY);
- memset(listEntryPtr, 0, sizeof(struct tapeEntryList));
/* Fill in tape entry so we can save it later */
strcpy(tapeEntryPtr->name, TNAME(&oldTapeLabel));
afs_int32 code = 0;
int tlock = 0;
- ctPtr = (udbClientTextP) malloc(sizeof(*ctPtr));
+ ctPtr = calloc(1, sizeof(*ctPtr));
if (!ctPtr)
ERROR_EXIT(TC_NOMEMORY);
- memset(ctPtr, 0, sizeof(*ctPtr));
ctPtr->textType = textType;
/* lock the text in the database */
udbClientTextP ctPtr = 0;
afs_int32 textType;
- ctPtr = (udbClientTextP) malloc(sizeof(*ctPtr));
+ ctPtr = malloc(sizeof(*ctPtr));
if (!ctPtr)
ERROR_EXIT(TC_NOMEMORY);
/* allocate buffer for text */
readBlockSize = BUTM_BLKSIZE;
- readBuffer = (char *)malloc(readBlockSize);
+ readBuffer = malloc(readBlockSize);
if (!readBuffer)
ERROR_EXIT(TC_NOMEMORY);
ERROR_EXIT(TC_ABORTEDBYREQUEST);
if (!tapeReadBuffer) {
- tapeReadBuffer = (char *)malloc(BUTM_BLOCKSIZE);
+ tapeReadBuffer = malloc(BUTM_BLOCKSIZE);
if (!tapeReadBuffer)
ERROR_EXIT(TC_NOMEMORY);
}