X-Git-Url: https://git.wh0rd.org/?p=dump.git;a=blobdiff_plain;f=restore%2Fdirs.c;h=2717f9421dc0b2588132e3682a9c9358299df867;hp=b049f49007801c6caa8c70d755b38ecce9dbc860;hb=4a9a33ef6c2f09149c5ab3f89e42572ef38801e1;hpb=cca7148b36e60b4671518602ff9a7c2d0c22a7b2 diff --git a/restore/dirs.c b/restore/dirs.c index b049f49..2717f94 100644 --- a/restore/dirs.c +++ b/restore/dirs.c @@ -42,7 +42,7 @@ #ifndef lint static const char rcsid[] = - "$Id: dirs.c,v 1.32 2005/05/02 15:10:46 stelian Exp $"; + "$Id: dirs.c,v 1.35 2008/04/17 15:16:47 stelian Exp $"; #endif /* not lint */ #include @@ -673,7 +673,7 @@ setdirmodes(int flags) fprintf(stderr, "directory mode, owner, and times not set\n"); return; } - mf = fopen(modefile, "r"); + mf = FOPEN(modefile, "r"); if (mf == NULL) { warn("fopen"); fprintf(stderr, "cannot open mode file %s\n", modefile); @@ -710,6 +710,10 @@ setdirmodes(int flags) cp = myname(ep); (void) chown(cp, node.uid, node.gid); (void) chmod(cp, node.mode); + utimes(cp, node.timep); + if (node.xattr) + xattr_extract(cp, xattr); + ep->e_flags &= ~NEW; if (node.flags) #ifdef __linux__ (void) lsetflags(cp, node.flags); @@ -719,10 +723,6 @@ setdirmodes(int flags) (void) chflags(cp, node.flags); #endif #endif - utimes(cp, node.timep); - if (node.xattr) - xattr_extract(cp, xattr); - ep->e_flags &= ~NEW; } } if (ferror(mf)) @@ -747,7 +747,7 @@ comparedirmodes(void) fprintf(stderr, "directory mode, owner, and times not set\n"); return; } - mf = fopen(modefile, "r"); + mf = FOPEN(modefile, "r"); if (mf == NULL) { warn("fopen"); fprintf(stderr, "cannot open mode file %s\n", modefile); @@ -769,10 +769,10 @@ comparedirmodes(void) if (ep == NULL) { panic("cannot find directory inode %d\n", node.ino); } else { - cp = myname(ep); struct STAT sb; unsigned long newflags; + cp = myname(ep); if (LSTAT(cp, &sb) < 0) { warn("unable to stat %s", cp); do_compare_error;