From 9be511dc8a07570d6c95075573272fce6e9113d4 Mon Sep 17 00:00:00 2001 From: Stelian Pop Date: Sun, 20 Aug 2000 15:17:36 +0000 Subject: [PATCH] Do not add links several times in restore --- CHANGES | 8 +++++++- restore/restore.c | 9 +++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index c04282a..9cac5b0 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,4 @@ -$Id: CHANGES,v 1.73 2000/08/19 23:48:10 stelian Exp $ +$Id: CHANGES,v 1.74 2000/08/20 15:17:36 stelian Exp $ Changes between versions 0.4b17 and 0.4b19 (released ?????????????) =================================================================== @@ -24,6 +24,12 @@ Changes between versions 0.4b17 and 0.4b19 (released ?????????????) this in the man page. Thanks to Bernhard Erdmann for reporting the bug. +6. Fixed a small harmless bug in restore which caused + in some conditions hard links to be restored several + times (therefore generation some warning messages). + Thanks to Kenneth Porter for + reporting the bug. + Changes between versions 0.4b17 and 0.4b18 (released June 30, 2000) =================================================================== diff --git a/restore/restore.c b/restore/restore.c index d438f41..fe6c2cc 100644 --- a/restore/restore.c +++ b/restore/restore.c @@ -40,7 +40,7 @@ #ifndef lint static const char rcsid[] = - "$Id: restore.c,v 1.9 2000/06/01 18:30:08 stelian Exp $"; + "$Id: restore.c,v 1.10 2000/08/20 15:17:36 stelian Exp $"; #endif /* not lint */ #include @@ -89,7 +89,7 @@ listfile(char *name, ino_t ino, int type) long addfile(char *name, ino_t ino, int type) { - register struct entry *ep; + register struct entry *ep, *np; long descend = hflag ? GOOD : FAIL; char buf[100]; @@ -114,6 +114,11 @@ addfile(char *name, ino_t ino, int type) 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) -- 2.39.5