This commit was generated by cvs2svn to compensate for changes in r23669,
which included commits to RCS files with non-trunk default branches.
This commit is contained in:
commit
39e5614a71
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=23670
@ -32,7 +32,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char sccsid[] = "@(#)unctime.c 8.1 (Berkeley) 6/5/93";
|
static char sccsid[] = "@(#)unctime.c 8.2 (Berkeley) 6/14/94";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@ -66,8 +66,6 @@ static char sccsid[] = "@(#)unctime.c 8.1 (Berkeley) 6/5/93";
|
|||||||
#define E_SECOND 17
|
#define E_SECOND 17
|
||||||
#define E_YEAR 20
|
#define E_YEAR 20
|
||||||
|
|
||||||
static int dcmp __P((struct tm *, struct tm *));
|
|
||||||
static time_t emitl __P((struct tm *));
|
|
||||||
static int lookup __P((char *));
|
static int lookup __P((char *));
|
||||||
|
|
||||||
|
|
||||||
@ -88,7 +86,8 @@ unctime(str)
|
|||||||
then.tm_min = atoi(&dbuf[E_MINUTE]);
|
then.tm_min = atoi(&dbuf[E_MINUTE]);
|
||||||
then.tm_sec = atoi(&dbuf[E_SECOND]);
|
then.tm_sec = atoi(&dbuf[E_SECOND]);
|
||||||
then.tm_year = atoi(&dbuf[E_YEAR]) - 1900;
|
then.tm_year = atoi(&dbuf[E_YEAR]) - 1900;
|
||||||
return(emitl(&then));
|
then.tm_isdst = -1;
|
||||||
|
return(mktime(&then));
|
||||||
}
|
}
|
||||||
|
|
||||||
static char months[] =
|
static char months[] =
|
||||||
@ -105,53 +104,3 @@ lookup(str)
|
|||||||
return((cp-months) / 3);
|
return((cp-months) / 3);
|
||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
* Routine to convert a localtime(3) format date back into
|
|
||||||
* a system format date.
|
|
||||||
*
|
|
||||||
* Use a binary search.
|
|
||||||
*/
|
|
||||||
|
|
||||||
static time_t
|
|
||||||
emitl(dp)
|
|
||||||
struct tm *dp;
|
|
||||||
{
|
|
||||||
time_t conv;
|
|
||||||
register int i, bit;
|
|
||||||
struct tm dcopy;
|
|
||||||
|
|
||||||
dcopy = *dp;
|
|
||||||
dp = &dcopy;
|
|
||||||
conv = 0;
|
|
||||||
for (i = 30; i >= 0; i--) {
|
|
||||||
bit = 1 << i;
|
|
||||||
conv |= bit;
|
|
||||||
if (dcmp(localtime(&conv), dp) > 0)
|
|
||||||
conv &= ~bit;
|
|
||||||
}
|
|
||||||
return(conv);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Compare two localtime dates, return result.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define DECIDE(a) \
|
|
||||||
if (dp->a > dp2->a) \
|
|
||||||
return(1); \
|
|
||||||
if (dp->a < dp2->a) \
|
|
||||||
return(-1)
|
|
||||||
|
|
||||||
static int
|
|
||||||
dcmp(dp, dp2)
|
|
||||||
register struct tm *dp, *dp2;
|
|
||||||
{
|
|
||||||
|
|
||||||
DECIDE(tm_year);
|
|
||||||
DECIDE(tm_mon);
|
|
||||||
DECIDE(tm_mday);
|
|
||||||
DECIDE(tm_hour);
|
|
||||||
DECIDE(tm_min);
|
|
||||||
DECIDE(tm_sec);
|
|
||||||
return(0);
|
|
||||||
}
|
|
||||||
|
@ -30,15 +30,15 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* @(#)extern.h 8.1 (Berkeley) 6/5/93
|
* @(#)extern.h 8.2 (Berkeley) 5/24/95
|
||||||
*/
|
*/
|
||||||
|
|
||||||
u_long cksum __P((void *, size_t));
|
u_long cksum __P((void *, size_t));
|
||||||
u_short dkcksum __P((struct disklabel *));
|
u_short dkcksum __P((struct disklabel *));
|
||||||
void fatal __P((const char *fmt, ...));
|
void fatal __P((const char *fmt, ...));
|
||||||
u_int log2 __P((u_int));
|
u_int log2 __P((u_int));
|
||||||
int make_lfs
|
int make_lfs __P((int, struct disklabel *, struct partition *, int,
|
||||||
__P((int, struct disklabel *, struct partition *, int, int, int));
|
int, int, int));
|
||||||
int mkfs __P((struct partition *, char *, int, int));
|
int mkfs __P((struct partition *, char *, int, int));
|
||||||
|
|
||||||
extern char *progname;
|
extern char *progname;
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* @(#)restore.h 8.2 (Berkeley) 1/21/94
|
* @(#)restore.h 8.3 (Berkeley) 9/13/94
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -53,7 +53,7 @@ extern int yflag; /* always try to recover from tape errors */
|
|||||||
* Global variables
|
* Global variables
|
||||||
*/
|
*/
|
||||||
extern char *dumpmap; /* map of inodes on this dump tape */
|
extern char *dumpmap; /* map of inodes on this dump tape */
|
||||||
extern char *clrimap; /* map of inodes to be deleted */
|
extern char *usedinomap; /* map of inodes that are in use on this fs */
|
||||||
extern ino_t maxino; /* highest numbered inode in this file system */
|
extern ino_t maxino; /* highest numbered inode in this file system */
|
||||||
extern long dumpnum; /* location of the dump on this tape */
|
extern long dumpnum; /* location of the dump on this tape */
|
||||||
extern long volno; /* current volume being read */
|
extern long volno; /* current volume being read */
|
||||||
@ -129,6 +129,8 @@ typedef struct rstdirdesc RST_DIR;
|
|||||||
*/
|
*/
|
||||||
#define TSTINO(ino, map) \
|
#define TSTINO(ino, map) \
|
||||||
(map[(u_int)((ino) - 1) / NBBY] & (1 << ((u_int)((ino) - 1) % NBBY)))
|
(map[(u_int)((ino) - 1) / NBBY] & (1 << ((u_int)((ino) - 1) % NBBY)))
|
||||||
|
#define SETINO(ino, map) \
|
||||||
|
map[(u_int)((ino) - 1) / NBBY] |= 1 << ((u_int)((ino) - 1) % NBBY)
|
||||||
|
|
||||||
#define dprintf if (dflag) fprintf
|
#define dprintf if (dflag) fprintf
|
||||||
#define vprintf if (vflag) fprintf
|
#define vprintf if (vflag) fprintf
|
||||||
|
Loading…
Reference in New Issue
Block a user