char buf[BUFSIZ], *bufp, *bufp1, *typep, *cmd, *bp;
register afs_int32 code, c, fd, id, pflags = -1, len, core = 0, lastE = 0;
char comLine[60], coreName[40], name[40], lastErrorName[50];
- afs_int32 pid = -1, lastExit = -1, lastSignal = -1, rsTime = -1, rsCount =
- -1;
- afs_int32 procStartTime = -1, procStarts = -1;
- afs_int32 lastAnyExit = -1, lastErrorExit = -1, errorCode =
- -1, errorSignal = -1, goal = -1;
+ afs_int32 pid = -1, lastExit = -1, lastSignal = -1, rsCount = -1;
+ afs_int32 procStarts = -1;
+ afs_int32 errorCode = -1, errorSignal = -1, goal = -1;
+ time_t procStartTime = -1, rsTime = -1, lastAnyExit = -1, lastErrorExit = -1;
char *timeStamp;
typep = (char *)malloc(50);
fprintf(stderr, "\nDUMP %u\n", tapeLabelPtr->label.dumpid);
if (printlabels) {
+ time_t t;
+
fprintf(stderr, " AFS Tape Name : %s\n",
tapeLabelPtr->label.AFSName);
fprintf(stderr, " Permanent Name : %s\n",
tapeLabelPtr->label.pName);
fprintf(stderr, " Dump Id : %u\n",
tapeLabelPtr->label.dumpid);
+ t = tapeLabelPtr->label.dumpid;
fprintf(stderr, " Dump Id Time : %.24s\n",
- ctime(&(tapeLabelPtr->label.dumpid)));
+ ctime(&t));
+ t = tapeLabelPtr->label.creationTime;
fprintf(stderr, " Date Created : %.24s\n",
- ctime(&(tapeLabelPtr->label.creationTime)));
+ ctime(&t));
+ t = tapeLabelPtr->label.expirationDate;
fprintf(stderr, " Date Expires : %.24s\n",
- ctime(&(tapeLabelPtr->label.expirationDate)));
+ ctime(&t));
fprintf(stderr, " Version Number : %d\n",
tapeLabelPtr->label.structVersion);
fprintf(stderr, " Tape Use Count : %d\n",
headerPtr->cloneDate = ntohl(headerPtr->cloneDate);
if (headerPtr->magic == TC_VOLBEGINMAGIC) {
+ time_t t;
+
*isvolheader = 1;
if (verbose)
fprintf(stderr, "Volume header\n");
+ t = headerPtr->from;
fprintf(stderr,
"VOLUME %3d %s (%u) - %s dump from %.24s",
++volcount, headerPtr->volumeName, headerPtr->volumeID,
(headerPtr->level ? "Incr" : "Full"),
- ((headerPtr->from) ? (char *)ctime(&headerPtr->from) : "0"));
+ (t ? (char *)ctime(&t) : "0"));
/* do not include two ctime() calls in the same fprintf call as
* the same string buffer will be returned by each call. */
- fprintf(stderr,
- " till %.24s\n",
- ctime(&(headerPtr->cloneDate)));
+ t = headerPtr->cloneDate;
+ fprintf(stderr, " till %.24s\n", ctime(&t));
if (printheaders) {
fprintf(stderr, " Volume Name = %s\n",
headerPtr->volumeName);
fprintf(stderr, " Volume ID = %u\n", headerPtr->volumeID);
+ t = headerPtr->cloneDate;
fprintf(stderr, " Clone Date = %.24s\n",
- ctime(&headerPtr->cloneDate));
+ ctime(&t));
fprintf(stderr, " Vol Fragment = %d\n", headerPtr->frag);
fprintf(stderr, " Vol Continued = 0x%x\n", headerPtr->contd);
fprintf(stderr, " DumpSet Name = %s\n",
headerPtr->dumpSetName);
fprintf(stderr, " Dump ID = %u\n", headerPtr->dumpID);
fprintf(stderr, " Dump Level = %d\n", headerPtr->level);
+ t = headerPtr->from;
fprintf(stderr, " Dump Since = %.24s\n",
- ctime(&headerPtr->from));
+ ctime(&t));
fprintf(stderr, " parent Dump ID = %u\n", headerPtr->parentID);
}
} else if (headerPtr->magic == TC_VOLENDMAGIC) {
#include <afs/param.h>
+#include <afs/afsutil.h>
#include <afs/stds.h>
#include <sys/types.h>
#ifdef AFS_NT40_ENV
/* time */
#define DPFT(T, name, var) \
do { \
- char * last; \
- printf(T "%s = \"%s\"\n", name, strtok_r(ctime(&(var)), "\r\n", &last)); \
+ time_t t = var; \
+ printf(T "%s = \"%.24s\"\n", name, ctime(&t)); \
} while(0)
#define DPFT1(name, var) DPFT(DPFTB1, name, var)
#define DPFT2(name, var) DPFT(DPFTB2, name, var)
#include <stdio.h>
#include <stdarg.h>
+#include <string.h>
extern int LogLevel;
extern int mrafsStyleLogs;
char **argv;
{
long code, temp;
+ time_t t;
if (argc <= 1) {
printf("dtest: usage is 'dtest <time to interpret>'\n");
}
code = ktime_DateToLong(argv[1], &temp);
+ t = temp;
if (code) {
printf("date parse failed with code %d.\n", code);
} else {
printf("returned %d, which, run through ctime, yields %s", temp,
- ctime(&temp));
+ ctime(&t));
}
exit(0);
}
{
struct ktime ttime;
long ntime, code;
+ time_t t;
if (argc <= 1) {
printf("ktest: usage is 'ktest <periodic date to evaluate>'\n");
}
ntime = ktime_next(&ttime, 0);
- printf("time is %d, %s", ntime, ctime(&ntime));
+ t = ntime;
+ printf("time is %d, %s", ntime, ctime(&t));
exit(0);
}
int argc;
char *argv[];
{
- long code;
+ long code, temp;
int errors;
- long t;
+ time_t t;
struct testTime *tt;
/* should do timezone and daylight savings time correction so this program
* work in other than EST */
if (argc > 1) {
- code = util_GetLong(argv[1], &t);
+ code = util_GetLong(argv[1], &temp);
+ t = temp;
if (code) { /* assume its a date string */
- code = ktime_DateToLong(argv[1], &t);
- printf("The string %s gives %d; ctime yields %s", argv[1], t,
+ code = ktime_DateToLong(argv[1], &temp);
+ t = temp;
+ printf("The string %s gives %d; ctime yields %s", argv[1], temp,
ctime(&t));
} else {
- printf("The value %d is %s", t, ctime(&t));
+ printf("The value %d is %s", temp, ctime(&t));
}
exit(0);
}
register char *p;
struct passwd *pw;
char *ctime();
+ time_t t;
printf(" I=%u ", ino);
if (ino < ROOTINO || ino > maxino)
#else
printf("SIZE=%ld ", dp->di_size);
#endif
- p = ctime(&dp->di_mtime);
+ t = dp->di_mtime;
+ p = ctime(&t);
printf("MTIME=%12.12s %4.4s ", p + 4, p + 20);
}
}
now = ReadDump(*argv, timebits);
if (stats || noptions == 0) {
- time_t uxtfirst = UXtime(tfirst);
- printf("The time of the dump was %u %s", (unsigned int) now, ctime(&now));
+ time_t uxtfirst = UXtime(tfirst), tnow = now;
+ printf("The time of the dump was %u %s", (unsigned int) now, ctime(&tnow));
printf("The last time cleanup ran was %u %s", (unsigned int) uxtfirst,
ctime(&uxtfirst));
PrintCallBackStats();
char strg[30];
time_t start_time = stats->start_time;
- strncpy(strg, ctime(&start_time), sizeof(strg));
+ afs_ctime(&start_time, strg, sizeof(strg));
strg[strlen(strg) - 1] = 0;
printf("Dynamic statistics stats (starting time: %s):\n", strg);
printf("OpcodeName\t# Requests\t# Aborts\n");
return (error);
}
-static char *
-vos_ctime(afs_int32 *timep)
-{
- time_t foo = *timep;
- return ctime(&foo);
-}
-
static void
DisplayFormat(volintInfo *pntr, afs_int32 server, afs_int32 part,
int *totalOK, int *totalNotOK, int *totalBusy, int fast,
int longlist, int disp)
{
char pname[10];
+ time_t t;
if (fast) {
fprintf(STDOUT, "%-10lu\n", (unsigned long)pntr->volid);
(unsigned long)pntr->cloneID,
(unsigned long)pntr->backupID);
fprintf(STDOUT, " MaxQuota %10d K \n", pntr->maxquota);
+ t = pntr->creationDate;
fprintf(STDOUT, " Creation %s",
- vos_ctime(& pntr->creationDate));
+ ctime(&t));
#ifdef FULL_LISTVOL_SWITCH
+ t = pntr->copyDate;
fprintf(STDOUT, " Copy %s",
- vos_ctime( & pntr->copyDate));
- if (!pntr->backupDate)
+ ctime(&t));
+
+ t = pntr->backupDate;
+ if (!t)
fprintf(STDOUT, " Backup Never\n");
else
fprintf(STDOUT, " Backup %s",
- vos_ctime( & pntr->backupDate));
- if (pntr->accessDate)
+ ctime(&t));
+
+ t = pntr->accessDate;
+ if (t)
fprintf(STDOUT, " Last Access %s",
- vos_ctime( & pntr->accessDate));
+ ctime(&t));
#endif
- if (!pntr->updateDate)
+ t = pntr->updateDate;
+ if (!t)
fprintf(STDOUT, " Last Update Never\n");
else
fprintf(STDOUT, " Last Update %s",
- vos_ctime( & pntr->updateDate));
+ ctime(&t));
fprintf(STDOUT,
" %d accesses in the past day (i.e., vnode references)\n",
pntr->dayUse);
int *a_totalOKP, int *a_totalNotOKP, int *a_totalBusyP,
int a_fast, int a_int32, int a_showProblems)
{ /*XDisplayFormat */
-
+ time_t t;
char pname[10];
if (a_fast) {
(unsigned long)a_xInfoP->cloneID,
(unsigned long)a_xInfoP->backupID);
fprintf(STDOUT, " MaxQuota %10d K \n", a_xInfoP->maxquota);
+
+ t = a_xInfoP->creationDate;
fprintf(STDOUT, " Creation %s",
- vos_ctime( & a_xInfoP->creationDate));
+ ctime(&t));
#ifdef FULL_LISTVOL_SWITCH
+ t = a_xInfoP->copyDate;
fprintf(STDOUT, " Copy %s",
- vos_ctime( & a_xInfoP->copyDate));
- if (!a_xInfoP->backupDate)
+ ctime(&t));
+
+ t = a_xInfoP->backupDate;
+ if (!t)
fprintf(STDOUT, " Backup Never\n");
else
fprintf(STDOUT, " Backup %s",
- vos_ctime( & a_xInfoP->backupDate));
- if (a_xInfoP->accessDate)
+ ctime(&t));
+
+ t = a_xInfoP->accessDate;
+ if (t)
fprintf(STDOUT, " Last Access %s",
- vos_ctime( & a_xInfoP->accessDate));
+ ctime(&t));
#endif
- if (!a_xInfoP->updateDate)
+ t = a_xInfoP->updateDate;
+ if (!t)
fprintf(STDOUT, " Last Update Never\n");
else
fprintf(STDOUT, " Last Update %s",
- vos_ctime( & a_xInfoP->updateDate));
+ ctime(&t));
fprintf(STDOUT,
" %d accesses in the past day (i.e., vnode references)\n",
a_xInfoP->dayUse);
int *a_totalOKP, int *a_totalNotOKP, int *a_totalBusyP,
int a_fast, int a_int32, int a_showProblems)
{ /*XDisplayFormat */
+ time_t t;
if (a_fast) {
/*
* Short & sweet.
fprintf(STDOUT, "type\t\t?\n");
break;
}
+ t = a_xInfoP->creationDate;
fprintf(STDOUT, "creationDate\t%-9lu\t%s",
afs_printable_uint32_lu(a_xInfoP->creationDate),
- vos_ctime(&a_xInfoP->creationDate));
+ ctime(&t));
+
+ t = a_xInfoP->accessDate;
fprintf(STDOUT, "accessDate\t%-9lu\t%s",
afs_printable_uint32_lu(a_xInfoP->accessDate),
- vos_ctime(&a_xInfoP->accessDate));
+ ctime(&t));
+
+ t = a_xInfoP->updateDate;
fprintf(STDOUT, "updateDate\t%-9lu\t%s",
afs_printable_uint32_lu(a_xInfoP->updateDate),
- vos_ctime(&a_xInfoP->updateDate));
+ ctime(&t));
+
+ t = a_xInfoP->backupDate;
fprintf(STDOUT, "backupDate\t%-9lu\t%s",
afs_printable_uint32_lu(a_xInfoP->backupDate),
- vos_ctime(&a_xInfoP->backupDate));
+ ctime(&t));
+
+ t = a_xInfoP->copyDate;
fprintf(STDOUT, "copyDate\t%-9lu\t%s",
afs_printable_uint32_lu(a_xInfoP->copyDate),
- vos_ctime(&a_xInfoP->copyDate));
+ ctime(&t));
fprintf(STDOUT, "diskused\t%u\n", a_xInfoP->size);
fprintf(STDOUT, "maxquota\t%u\n", a_xInfoP->maxquota);
{
static long server_cache = -1, partition_cache = -1;
static char hostname[256], address[32], pname[16];
+ time_t t;
if (server != server_cache) {
struct in_addr s;
fprintf(STDOUT, "type\t\t?\n");
break;
}
+ t = pntr->creationDate;
fprintf(STDOUT, "creationDate\t%-9lu\t%s",
afs_printable_uint32_lu(pntr->creationDate),
- vos_ctime(&pntr->creationDate));
+ ctime(&t));
+
+ t = pntr->accessDate;
fprintf(STDOUT, "accessDate\t%-9lu\t%s",
afs_printable_uint32_lu(pntr->accessDate),
- vos_ctime(&pntr->accessDate));
+ ctime(&t));
+
+ t = pntr->updateDate;
fprintf(STDOUT, "updateDate\t%-9lu\t%s",
afs_printable_uint32_lu(pntr->updateDate),
- vos_ctime(&pntr->updateDate));
+ ctime(&t));
+
+ t = pntr->backupDate;
fprintf(STDOUT, "backupDate\t%-9lu\t%s",
afs_printable_uint32_lu(pntr->backupDate),
- vos_ctime(&pntr->backupDate));
+ ctime(&t));
+
+ t = pntr->copyDate;
fprintf(STDOUT, "copyDate\t%-9lu\t%s",
afs_printable_uint32_lu(pntr->copyDate),
- vos_ctime(&pntr->copyDate));
+ ctime(&t));
+
fprintf(STDOUT, "flags\t\t%#lx\t(Optional)\n",
afs_printable_uint32_lu(pntr->flags));
fprintf(STDOUT, "diskused\t%u\n", pntr->size);
afs_int32 count;
int i;
char pname[10];
+ time_t t;
server = GetServer(as->parms[0].items->data);
if (!server) {
for (i = 0; i < count; i++) {
/*print out the relevant info */
fprintf(STDOUT, "--------------------------------------\n");
+ t = pntr->time;
fprintf(STDOUT, "transaction: %lu created: %s",
- (unsigned long)pntr->tid, vos_ctime( & pntr->time));
+ (unsigned long)pntr->tid, ctime(&t));
if (pntr->returnCode) {
fprintf(STDOUT, "returnCode: %lu\n",
(unsigned long)pntr->returnCode);