#ifndef lint
static const char rcsid[] =
- "$Id: symtab.c,v 1.23 2004/12/14 14:07:58 stelian Exp $";
+ "$Id: symtab.c,v 1.26 2005/07/07 08:47:16 stelian Exp $";
#endif /* not lint */
/*
*/
#include <config.h>
+#include <compatlfs.h>
#include <sys/param.h>
#include <sys/stat.h>
char *np, *cp;
char buf[MAXPATHLEN];
+ ep = lookupino(ROOTINO);
+
cp = name;
+ if (*cp == '.')
+ ++cp;
+ if (*cp == '/')
+ ++cp;
+ if (*cp == '\0')
+ return ep;
- ep = lookupino(ROOTINO);
while (ep != NULL) {
for (np = buf; *cp != '/' && *cp != '\0' &&
np < &buf[sizeof(buf)]; )
oldep = ep;
- if (strcmp(ep->e_name, buf) != 0 &&
- ep->e_entries != NULL) {
+ if (ep->e_entries != NULL) {
ep = ep->e_entries[dir_hash(buf)];
for ( ; ep != NULL; ep = ep->e_sibling)
Vprintf(stdout, "Check pointing the restore\n");
if (Nflag)
return;
- if ((fd = fopen(filename, "w")) == NULL) {
+ if ((fd = FOPEN(filename, "w")) == NULL) {
warn("fopen");
panic("cannot create save file %s for symbol table\n",
filename);
struct entry *ep;
struct entry *baseep, *lep;
struct symtableheader hdr;
- struct stat stbuf;
+ struct STAT stbuf;
long i;
int fd;
ep->e_flags |= NEW;
return;
}
- if ((fd = open(filename, O_RDONLY, 0)) < 0) {
+ if ((fd = OPEN(filename, O_RDONLY, 0)) < 0) {
warn("open");
errx(1, "cannot open symbol table file %s", filename);
}
- if (fstat(fd, &stbuf) < 0) {
+ if (FSTAT(fd, &stbuf) < 0) {
warn("stat");
errx(1, "cannot stat symbol table file %s", filename);
}
panic("initsymtable called from command %c\n", command);
break;
}
- resizemaps(maxino, hdr.maxino);
- maxino = hdr.maxino;
+ if (hdr.maxino > maxino) {
+ resizemaps(maxino, hdr.maxino);
+ maxino = hdr.maxino;
+ }
entrytblsize = hdr.entrytblsize;
entry = (struct entry **)
(base + tblsize - (entrytblsize * sizeof(struct entry *)));