diff options
| author | Warner Losh <imp@FreeBSD.org> | 2000-07-25 19:05:09 +0000 |
|---|---|---|
| committer | Warner Losh <imp@FreeBSD.org> | 2000-07-25 19:05:09 +0000 |
| commit | c96eb6d2e815d0e293e03919014bd08868d9dc73 (patch) | |
| tree | 19f6537a2eeecbd597fe865e3176352f48964921 /usr.sbin/mtree/verify.c | |
| parent | da010626df7e62a562c36f5315b625913dd65bdc (diff) | |
Notes
Diffstat (limited to 'usr.sbin/mtree/verify.c')
| -rw-r--r-- | usr.sbin/mtree/verify.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/usr.sbin/mtree/verify.c b/usr.sbin/mtree/verify.c index d25797b9da14..a599fadc5818 100644 --- a/usr.sbin/mtree/verify.c +++ b/usr.sbin/mtree/verify.c @@ -53,7 +53,7 @@ static const char rcsid[] = extern long int crc_total; extern int ftsoptions; -extern int dflag, eflag, rflag, sflag, uflag; +extern int dflag, eflag, qflag, rflag, sflag, uflag; extern char fullpath[MAXPATHLEN]; extern int lineno; @@ -171,8 +171,16 @@ miss(p, tail) if (p->type != F_DIR && (dflag || p->flags & F_VISIT)) continue; (void)strcpy(tail, p->name); - if (!(p->flags & F_VISIT)) - (void)printf("missing: %s", path); + if (!(p->flags & F_VISIT)) { + /* Don't print missing message if file exists as a + symbolic link and the -q flag is set. */ + struct stat statbuf; + + if (qflag && stat(path, &statbuf) == 0) + p->flags |= F_VISIT; + else + (void)printf("missing: %s", path); + } if (p->type != F_DIR && p->type != F_LINK) { putchar('\n'); continue; |
