* 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 <pop@noos.fr>, 1999-2000
+ * Stelian Pop <pop@noos.fr> - AlcĂ´ve <www.alcove.fr>, 2000
*/
/*
#ifndef lint
static const char rcsid[] =
- "$Id: restore.c,v 1.6 1999/10/13 09:57:21 stelian Exp $";
+ "$Id: restore.c,v 1.14 2001/03/20 10:02:48 stelian Exp $";
#endif /* not lint */
+#include <config.h>
#include <sys/types.h>
#ifdef __linux__
* List entries on the tape.
*/
long
-listfile(char *name, ino_t ino, int type)
+listfile(char *name, dump_ino_t ino, int type)
{
long descend = hflag ? GOOD : FAIL;
* Request that new entries be extracted.
*/
long
-addfile(char *name, ino_t ino, int type)
+addfile(char *name, dump_ino_t ino, int type)
{
- register struct entry *ep;
+ register struct entry *ep, *np;
long descend = hflag ? GOOD : FAIL;
char buf[100];
return (descend);
}
type |= LINK;
+ for (np = ep->e_links; np; np = np->e_links)
+ if (strcmp(name, myname(np)) == 0) {
+ np->e_flags |= NEW;
+ return (descend);
+ }
}
ep = addentry(name, ino, type);
if (type == NODE)
*/
/* ARGSUSED */
long
-deletefile(char *name, ino_t ino, int type)
+deletefile(char *name, dump_ino_t ino, int type)
{
long descend = hflag ? GOOD : FAIL;
struct entry *ep;
removeoldleaves(void)
{
register struct entry *ep, *nextep;
- register ino_t i, mydirino;
+ register dump_ino_t i, mydirino;
Vprintf(stdout, "Mark entries to be removed.\n");
if ((ep = lookupino(WINO))) {
* Renames are done at the same time.
*/
long
-nodeupdates(char *name, ino_t ino, int type)
+nodeupdates(char *name, dump_ino_t ino, int type)
{
register struct entry *ep, *np, *ip;
long descend = GOOD;
if (compare_ignore_not_found) break;
fprintf(stderr, "%s: (inode %lu) not found on tape\n",
name, (unsigned long)ino);
+ compare_errors = 1;
break;
/*
findunreflinks(void)
{
register struct entry *ep, *np;
- register ino_t i;
+ register dump_ino_t i;
Vprintf(stdout, "Find unreferenced names.\n");
for (i = ROOTINO; i < maxino; i++) {
static void
compare_entry(struct entry *ep, int do_compare)
{
- if ((ep->e_flags & (NEW|EXTRACT)) == 0)
+ if ((ep->e_flags & (NEW|EXTRACT)) == 0) {
badentry(ep, "unexpected file on tape");
+ compare_errors = 1;
+ }
if (do_compare) (void) comparefile(myname(ep));
ep->e_flags &= ~(NEW|EXTRACT);
}
compareleaves(void)
{
register struct entry *ep;
- ino_t first;
+ dump_ino_t first;
long curvol;
first = lowerbnd(ROOTINO);
if (ep == NULL)
panic("%d: bad first\n", first);
fprintf(stderr, "%s: not found on tape\n", myname(ep));
+ compare_errors = 1;
ep->e_flags &= ~(NEW|EXTRACT);
first = lowerbnd(first);
}
if (first != curfile.ino) {
fprintf(stderr, "expected next file %ld, got %lu\n",
(long)first, (unsigned long)curfile.ino);
+ compare_errors = 1;
skipfile();
goto next;
}
ep = lookupino(curfile.ino);
- if (ep == NULL)
+ if (ep == NULL) {
panic("unknown file on tape\n");
+ compare_errors = 1;
+ }
compare_entry(ep, 1);
for (ep = ep->e_links; ep != NULL; ep = ep->e_links) {
compare_entry(ep, 0);
createleaves(char *symtabfile)
{
register struct entry *ep;
- ino_t first;
+ dump_ino_t first;
long curvol;
if (command == 'R') {
void
createfiles(void)
{
- register ino_t first, next, last;
+ register dump_ino_t first, next, last;
register struct entry *ep;
long curvol;
createlinks(void)
{
register struct entry *np, *ep;
- register ino_t i;
+ register dump_ino_t i;
char name[BUFSIZ];
if ((ep = lookupino(WINO))) {
checkrestore(void)
{
register struct entry *ep;
- register ino_t i;
+ register dump_ino_t i;
Vprintf(stdout, "Check the symbol table.\n");
for (i = WINO; i < maxino; i++) {
* A paranoid check that things are as they should be.
*/
long
-verifyfile(char *name, ino_t ino, int type)
+verifyfile(char *name, dump_ino_t ino, int type)
{
struct entry *np, *ep;
long descend = GOOD;