Deleted Added
full compact
itime.c (85635) itime.c (86473)
1/*-
2 * Copyright (c) 1980, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 22 unchanged lines hidden (view full) ---

31 * SUCH DAMAGE.
32 */
33
34#ifndef lint
35#if 0
36static char sccsid[] = "@(#)itime.c 8.1 (Berkeley) 6/5/93";
37#endif
38static const char rcsid[] =
1/*-
2 * Copyright (c) 1980, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 22 unchanged lines hidden (view full) ---

31 * SUCH DAMAGE.
32 */
33
34#ifndef lint
35#if 0
36static char sccsid[] = "@(#)itime.c 8.1 (Berkeley) 6/5/93";
37#endif
38static const char rcsid[] =
39 "$FreeBSD: head/sbin/dump/itime.c 85635 2001-10-28 20:01:38Z dillon $";
39 "$FreeBSD: head/sbin/dump/itime.c 86473 2001-11-17 00:06:55Z iedowse $";
40#endif /* not lint */
41
42#include <sys/param.h>
43#include <sys/queue.h>
44#include <sys/time.h>
40#endif /* not lint */
41
42#include <sys/param.h>
43#include <sys/queue.h>
44#include <sys/time.h>
45#ifdef sunos
46#include <sys/vnode.h>
47
45
48#include <ufs/fsdir.h>
49#include <ufs/inode.h>
50#include <ufs/fs.h>
51#else
52#include <ufs/ufs/dinode.h>
46#include <ufs/ufs/dinode.h>
53#endif
54
55#include <protocols/dumprestore.h>
56
57#include <errno.h>
58#include <fcntl.h>
59#include <stdio.h>
60#ifdef __STDC__
61#include <stdlib.h>

--- 47 unchanged lines hidden (view full) ---

109 readdumptimes(df);
110 (void) fclose(df);
111}
112
113static void
114readdumptimes(df)
115 FILE *df;
116{
47
48#include <protocols/dumprestore.h>
49
50#include <errno.h>
51#include <fcntl.h>
52#include <stdio.h>
53#ifdef __STDC__
54#include <stdlib.h>

--- 47 unchanged lines hidden (view full) ---

102 readdumptimes(df);
103 (void) fclose(df);
104}
105
106static void
107readdumptimes(df)
108 FILE *df;
109{
117 register int i;
118 register struct dumptime *dtwalk;
110 int i;
111 struct dumptime *dtwalk;
119
120 for (;;) {
121 dtwalk = (struct dumptime *)calloc(1, sizeof (struct dumptime));
122 if (getrecord(df, &(dtwalk->dt_value)) < 0)
123 break;
124 nddates++;
125 SLIST_INSERT_HEAD(&dthead, dtwalk, dt_list);
126 }

--- 8 unchanged lines hidden (view full) ---

135 dtwalk = SLIST_FIRST(&dthead);
136 for (i = nddates - 1; i >= 0; i--, dtwalk = SLIST_NEXT(dtwalk, dt_list))
137 ddatev[i] = &dtwalk->dt_value;
138}
139
140void
141getdumptime()
142{
112
113 for (;;) {
114 dtwalk = (struct dumptime *)calloc(1, sizeof (struct dumptime));
115 if (getrecord(df, &(dtwalk->dt_value)) < 0)
116 break;
117 nddates++;
118 SLIST_INSERT_HEAD(&dthead, dtwalk, dt_list);
119 }

--- 8 unchanged lines hidden (view full) ---

128 dtwalk = SLIST_FIRST(&dthead);
129 for (i = nddates - 1; i >= 0; i--, dtwalk = SLIST_NEXT(dtwalk, dt_list))
130 ddatev[i] = &dtwalk->dt_value;
131}
132
133void
134getdumptime()
135{
143 register struct dumpdates *ddp;
144 register int i;
136 struct dumpdates *ddp;
137 int i;
145 char *fname;
146
147 fname = disk;
148#ifdef FDEBUG
149 msg("Looking for name %s in dumpdates = %s for level = %c\n",
150 fname, dumpdates, level);
151#endif
152 spcl.c_ddate = 0;

--- 15 unchanged lines hidden (view full) ---

168 lastlevel = ddp->dd_level;
169 }
170}
171
172void
173putdumptime()
174{
175 FILE *df;
138 char *fname;
139
140 fname = disk;
141#ifdef FDEBUG
142 msg("Looking for name %s in dumpdates = %s for level = %c\n",
143 fname, dumpdates, level);
144#endif
145 spcl.c_ddate = 0;

--- 15 unchanged lines hidden (view full) ---

161 lastlevel = ddp->dd_level;
162 }
163}
164
165void
166putdumptime()
167{
168 FILE *df;
176 register struct dumpdates *dtwalk;
177 register int i;
169 struct dumpdates *dtwalk;
170 int i;
178 int fd;
179 char *fname;
180 char *tmsg;
181
182 if(uflag == 0)
183 return;
184 if ((df = fopen(dumpdates, "r+")) == NULL)
185 quit("cannot rewrite %s: %s\n", dumpdates, strerror(errno));

--- 98 unchanged lines hidden ---
171 int fd;
172 char *fname;
173 char *tmsg;
174
175 if(uflag == 0)
176 return;
177 if ((df = fopen(dumpdates, "r+")) == NULL)
178 quit("cannot rewrite %s: %s\n", dumpdates, strerror(errno));

--- 98 unchanged lines hidden ---