verify.c (114601) | verify.c (121299) |
---|---|
1/*- 2 * Copyright (c) 1990, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 23 unchanged lines hidden (view full) --- 32 */ 33 34#if 0 35#ifndef lint 36static char sccsid[] = "@(#)verify.c 8.1 (Berkeley) 6/6/93"; 37#endif /* not lint */ 38#endif 39#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1990, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 23 unchanged lines hidden (view full) --- 32 */ 33 34#if 0 35#ifndef lint 36static char sccsid[] = "@(#)verify.c 8.1 (Berkeley) 6/6/93"; 37#endif /* not lint */ 38#endif 39#include <sys/cdefs.h> |
40__FBSDID("$FreeBSD: head/usr.sbin/mtree/verify.c 114601 2003-05-03 21:06:42Z obrien $"); | 40__FBSDID("$FreeBSD: head/usr.sbin/mtree/verify.c 121299 2003-10-21 07:58:52Z phk $"); |
41 42#include <sys/param.h> 43#include <sys/stat.h> 44#include <dirent.h> 45#include <err.h> 46#include <errno.h> 47#include <fts.h> 48#include <fnmatch.h> --- 9 unchanged lines hidden (view full) --- 58 59static NODE *root; 60static char path[MAXPATHLEN]; 61 62static void miss(NODE *, char *); 63static int vwalk(void); 64 65int | 41 42#include <sys/param.h> 43#include <sys/stat.h> 44#include <dirent.h> 45#include <err.h> 46#include <errno.h> 47#include <fts.h> 48#include <fnmatch.h> --- 9 unchanged lines hidden (view full) --- 58 59static NODE *root; 60static char path[MAXPATHLEN]; 61 62static void miss(NODE *, char *); 63static int vwalk(void); 64 65int |
66verify() | 66verify(void) |
67{ 68 int rval; 69 70 root = spec(); 71 rval = vwalk(); 72 miss(root, path); 73 return (rval); 74} 75 76static int | 67{ 68 int rval; 69 70 root = spec(); 71 rval = vwalk(); 72 miss(root, path); 73 return (rval); 74} 75 76static int |
77vwalk() | 77vwalk(void) |
78{ | 78{ |
79 register FTS *t; 80 register FTSENT *p; 81 register NODE *ep, *level; | 79 FTS *t; 80 FTSENT *p; 81 NODE *ep, *level; |
82 int specdepth, rval; 83 char *argv[2]; 84 char dot[] = "."; 85 86 argv[0] = dot; 87 argv[1] = NULL; 88 if ((t = fts_open(argv, ftsoptions, NULL)) == NULL) 89 err(1, "line %d: fts_open", lineno); --- 64 unchanged lines hidden (view full) --- 154 } 155 (void)fts_close(t); 156 if (sflag) 157 warnx("%s checksum: %lu", fullpath, (unsigned long)crc_total); 158 return (rval); 159} 160 161static void | 82 int specdepth, rval; 83 char *argv[2]; 84 char dot[] = "."; 85 86 argv[0] = dot; 87 argv[1] = NULL; 88 if ((t = fts_open(argv, ftsoptions, NULL)) == NULL) 89 err(1, "line %d: fts_open", lineno); --- 64 unchanged lines hidden (view full) --- 154 } 155 (void)fts_close(t); 156 if (sflag) 157 warnx("%s checksum: %lu", fullpath, (unsigned long)crc_total); 158 return (rval); 159} 160 161static void |
162miss(p, tail) 163 register NODE *p; 164 register char *tail; | 162miss(NODE *p, char *tail) |
165{ | 163{ |
166 register int create; 167 register char *tp; | 164 int create; 165 char *tp; |
168 const char *type; 169 170 for (; p; p = p->next) { 171 if (p->type != F_DIR && (dflag || p->flags & F_VISIT)) 172 continue; 173 (void)strcpy(tail, p->name); 174 if (!(p->flags & F_VISIT)) { 175 /* Don't print missing message if file exists as a --- 69 unchanged lines hidden --- | 166 const char *type; 167 168 for (; p; p = p->next) { 169 if (p->type != F_DIR && (dflag || p->flags & F_VISIT)) 170 continue; 171 (void)strcpy(tail, p->name); 172 if (!(p->flags & F_VISIT)) { 173 /* Don't print missing message if file exists as a --- 69 unchanged lines hidden --- |