#include <afsconfig.h>
#include <afs/param.h>
+#include <afs/procmgmt.h>
+#include <roken.h>
+
#ifdef IGNORE_SOME_GCC_WARNINGS
# pragma GCC diagnostic warning "-Wimplicit-function-declaration"
#endif
-#include <sys/types.h>
-#ifdef HAVE_STDINT_H
-# include <stdint.h>
-#endif
-#ifdef AFS_NT40_ENV
-#include <winsock2.h>
-#include <io.h>
-#else
-#include <sys/time.h>
-#include <sys/file.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#endif
-#include <errno.h>
#include <rx/xdr.h>
#include <rx/rx.h>
#include <afs/afsint.h>
-#include <stdio.h>
-#include <string.h>
-#include <afs/procmgmt.h>
#include <afs/afs_assert.h>
#include <afs/prs_fs.h>
-#include <fcntl.h>
#include <afs/nfs.h>
#include <lwp.h>
#include <lock.h>
#include <afs/butm_prototypes.h>
#include <afs/budb_prototypes.h>
#include <afs/afsutil.h>
+
#include "butc_internal.h"
#include "error_macros.h"
char tapeName[BU_MAXTAPELEN];
char strlevel[5];
struct timeval tp;
- struct timezone tzp;
afs_int32 curTime;
int tapecount = 1;
*/
else {
/* Check the tape's expiration date. Use the expiration on the label */
- gettimeofday(&tp, &tzp);
+ gettimeofday(&tp, NULL);
curTime = tp.tv_sec;
if (curTime < oldTapeLabel.expirationDate) {
TLog(taskId, "This tape has not expired\n");
saveDbToTape(void *param)
{
struct saveDbIf *saveDbIfPtr = (struct saveDbIf *)param;
- afs_int32 code = 0;
+ afs_int32 code;
afs_int32 i;
int wroteLabel;
afs_uint32 taskId;
extern struct deviceSyncNode *deviceLatch;
extern struct tapeConfig globalTapeConfig;
+ 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 */
extern struct tapeConfig globalTapeConfig;
extern struct deviceSyncNode *deviceLatch;
+ afs_pthread_setname_self("Db restore");
setStatus(taskId, DRIVE_WAIT);
EnterDeviceQueue(deviceLatch); /* lock tape device */
clearStatus(taskId, DRIVE_WAIT);
extern struct udbHandleS udbHandle;
+ afs_pthread_setname_self("Keep-alive");
while (1) {
#ifdef AFS_PTHREAD_ENV
sleep(5);
/* open the text file */
sprintf(filename, "%s/bu_XXXXXX", gettmpdir());
-#if defined (HAVE_MKSTEMP)
fid = mkstemp(filename);
-#else
- fid = open(mktemp(filename), O_RDWR | O_CREAT | O_EXCL, 0600);
-#endif
if (fid < 0) {
ErrorLog(0, rstTapeInfoPtr->taskId, errno, 0,
"Can't open temporary text file: %s\n", filename);