* Ported to Linux's Second Extended File System as part of the
* dump and restore backup suit
* Remy Card <card@Linux.EU.Org>, 1994-1997
* Ported to Linux's Second Extended File System as part of the
* dump and restore backup suit
* Remy Card <card@Linux.EU.Org>, 1994-1997
- * Stelian Pop <pop@cybercable.fr>, 1999
- *
+ * Stelian Pop <stelian@popies.net>, 1999-2000
+ * Stelian Pop <stelian@popies.net> - AlcĂ´ve <www.alcove.com>, 2000-2002
static char namebuf[MAXPATHLEN];
for (cp = &namebuf[MAXPATHLEN - 2]; cp > &namebuf[ep->e_namlen]; ) {
static char namebuf[MAXPATHLEN];
for (cp = &namebuf[MAXPATHLEN - 2]; cp > &namebuf[ep->e_namlen]; ) {
if (ep->e_flags != REMOVED)
badentry(ep, "not marked REMOVED");
if (ep->e_flags != REMOVED)
badentry(ep, "not marked REMOVED");
#define STRTBLINCR (sizeof(struct strhdr))
#define allocsize(size) (((size) + 1 + STRTBLINCR - 1) & ~(STRTBLINCR - 1))
#define STRTBLINCR (sizeof(struct strhdr))
#define allocsize(size) (((size) + 1 + STRTBLINCR - 1) & ~(STRTBLINCR - 1))
struct entry temp, *tentry;
long mynum = 1, stroff = 0;
FILE *fd;
struct entry temp, *tentry;
long mynum = 1, stroff = 0;
FILE *fd;
(void) fwrite((char *)&hdr, sizeof(struct symtableheader), 1, fd);
if (ferror(fd)) {
warn("fwrite");
(void) fwrite((char *)&hdr, sizeof(struct symtableheader), 1, fd);
if (ferror(fd)) {
warn("fwrite");
struct entry *baseep, *lep;
struct symtableheader hdr;
struct stat stbuf;
struct entry *baseep, *lep;
struct symtableheader hdr;
struct stat stbuf;
entry = (struct entry **)
calloc((unsigned)entrytblsize, sizeof(struct entry *));
if (entry == (struct entry **)NULL)
entry = (struct entry **)
calloc((unsigned)entrytblsize, sizeof(struct entry *));
if (entry == (struct entry **)NULL)
ep = addentry(".", ROOTINO, NODE);
ep->e_flags |= NEW;
return;
}
if ((fd = open(filename, O_RDONLY, 0)) < 0) {
warn("open");
ep = addentry(".", ROOTINO, NODE);
ep->e_flags |= NEW;
return;
}
if ((fd = open(filename, O_RDONLY, 0)) < 0) {
warn("open");
}
tblsize = stbuf.st_size - sizeof(struct symtableheader);
base = calloc(sizeof(char), (unsigned)tblsize);
if (base == NULL)
}
tblsize = stbuf.st_size - sizeof(struct symtableheader);
base = calloc(sizeof(char), (unsigned)tblsize);
if (base == NULL)
if (read(fd, base, (int)tblsize) < 0 ||
read(fd, (char *)&hdr, sizeof(struct symtableheader)) < 0) {
warn("read");
if (read(fd, base, (int)tblsize) < 0 ||
read(fd, (char *)&hdr, sizeof(struct symtableheader)) < 0) {
warn("read");