aboutsummaryrefslogtreecommitdiff
path: root/sbin/dump/itime.c
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/dump/itime.c')
-rw-r--r--sbin/dump/itime.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/sbin/dump/itime.c b/sbin/dump/itime.c
index 6209dab66feb..cd60c9efac75 100644
--- a/sbin/dump/itime.c
+++ b/sbin/dump/itime.c
@@ -40,6 +40,7 @@ static const char rcsid[] =
#endif /* not lint */
#include <sys/param.h>
+#include <sys/queue.h>
#include <sys/time.h>
#ifdef sunos
#include <sys/vnode.h>
@@ -63,10 +64,14 @@ static const char rcsid[] =
#include "dump.h"
+struct dumptime {
+ struct dumpdates dt_value;
+ SLIST_ENTRY(dumptime) dt_list;
+};
+SLIST_HEAD(dthead, dumptime) dthead = SLIST_HEAD_INITIALIZER(dthead);
struct dumpdates **ddatev = 0;
int nddates = 0;
int ddates_in = 0;
-struct dumptime *dthead = 0;
static void dumprecout __P((FILE *, struct dumpdates *));
static int getrecord __P((FILE *, struct dumpdates *));
@@ -117,8 +122,7 @@ readdumptimes(df)
if (getrecord(df, &(dtwalk->dt_value)) < 0)
break;
nddates++;
- dtwalk->dt_next = dthead;
- dthead = dtwalk;
+ SLIST_INSERT_HEAD(&dthead, dtwalk, dt_list);
}
ddates_in = 1;
@@ -128,8 +132,8 @@ readdumptimes(df)
*/
ddatev = (struct dumpdates **)
calloc((unsigned) (nddates + 1), sizeof (struct dumpdates *));
- dtwalk = dthead;
- for (i = nddates - 1; i >= 0; i--, dtwalk = dtwalk->dt_next)
+ dtwalk = SLIST_FIRST(&dthead);
+ for (i = nddates - 1; i >= 0; i--, dtwalk = SLIST_NEXT(dtwalk, dt_list))
ddatev[i] = &dtwalk->dt_value;
}
@@ -184,7 +188,6 @@ putdumptime()
free((char *)ddatev);
ddatev = 0;
nddates = 0;
- dthead = 0;
ddates_in = 0;
readdumptimes(df);
if (fseek(df, 0L, 0) < 0)