static char sccsid[] = "@(#)itime.c 8.1 (Berkeley) 6/5/93";
#endif
static const char rcsid[] =
- "$Id: itime.c,v 1.2 1999/10/11 12:53:22 stelian Exp $";
+ "$Id: itime.c,v 1.3 1999/10/11 12:59:18 stelian Exp $";
#endif /* not lint */
#include <sys/param.h>
static void readdumptimes __P((FILE *));
void
-initdumptimes()
+initdumptimes(void)
{
FILE *df;
}
static void
-readdumptimes(df)
- FILE *df;
+readdumptimes(FILE *df)
{
register int i;
register struct dumptime *dtwalk;
}
void
-getdumptime()
+getdumptime(void)
{
register struct dumpdates *ddp;
register int i;
spcl.c_ddate = 0;
lastlevel = '0';
+ /* if we're not going to update dumpdates, there's no point in reading
+ it, particularly since /var might not be mounted... wait until here
+ to benefit from the initialization of variables needed by parent */
+ if (uflag == 0)
+ return;
+
initdumptimes();
/*
* Go find the entry with the same name for a lower increment
}
void
-putdumptime()
+putdumptime(void)
{
FILE *df;
register struct dumpdates *dtwalk;
}
static void
-dumprecout(file, what)
- FILE *file;
- struct dumpdates *what;
+dumprecout(FILE *file, struct dumpdates *what)
{
if (fprintf(file, DUMPOUTFMT,
int recno;
static int
-getrecord(df, ddatep)
- FILE *df;
- struct dumpdates *ddatep;
+getrecord(FILE *df, struct dumpdates *ddatep)
{
char tbuf[BUFSIZ];
recno = 0;
- if ( (fgets(tbuf, sizeof (tbuf), df)) != tbuf)
+ if (fgets(tbuf, sizeof (tbuf), df) == NULL)
return(-1);
recno++;
if (makedumpdate(ddatep, tbuf) < 0)
}
static int
-makedumpdate(ddp, tbuf)
- struct dumpdates *ddp;
- char *tbuf;
+makedumpdate(struct dumpdates *ddp, char *tbuf)
{
- char un_buf[128];
+ char un_buf[BUFSIZ];
(void) sscanf(tbuf, DUMPINFMT, ddp->dd_name, &ddp->dd_level, un_buf);
ddp->dd_ddate = unctime(un_buf);