Deleted Added
full compact
compare.c (114601) compare.c (121299)
1/*-
2 * Copyright (c) 1989, 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[] = "@(#)compare.c 8.1 (Berkeley) 6/6/93";
37#endif /* not lint */
38#endif
39#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1989, 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[] = "@(#)compare.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/compare.c 114601 2003-05-03 21:06:42Z obrien $");
40__FBSDID("$FreeBSD: head/usr.sbin/mtree/compare.c 121299 2003-10-21 07:58:52Z phk $");
41
42#include <sys/param.h>
43#include <sys/stat.h>
44#include <err.h>
45#include <errno.h>
46#include <fcntl.h>
47#include <fts.h>
48#ifdef MD5

--- 20 unchanged lines hidden (view full) ---

69#define INDENTNAMELEN 8
70#define LABEL \
71 if (!label++) { \
72 len = printf("%s changed\n", RP(p)); \
73 tab = "\t"; \
74 }
75
76int
41
42#include <sys/param.h>
43#include <sys/stat.h>
44#include <err.h>
45#include <errno.h>
46#include <fcntl.h>
47#include <fts.h>
48#ifdef MD5

--- 20 unchanged lines hidden (view full) ---

69#define INDENTNAMELEN 8
70#define LABEL \
71 if (!label++) { \
72 len = printf("%s changed\n", RP(p)); \
73 tab = "\t"; \
74 }
75
76int
77compare(name, s, p)
78 char *name __unused;
79 register NODE *s;
80 register FTSENT *p;
77compare(char *name __unused, NODE *s, FTSENT *p)
81{
82 uint32_t val;
83 int fd, label;
84 off_t len;
85 char *cp;
86 const char *tab = "";
87 char *fflags;
88

--- 213 unchanged lines hidden (view full) ---

302 LABEL;
303 (void)printf("%slink_ref expected %s found %s\n",
304 tab, s->slink, cp);
305 }
306 return (label);
307}
308
309const char *
78{
79 uint32_t val;
80 int fd, label;
81 off_t len;
82 char *cp;
83 const char *tab = "";
84 char *fflags;
85

--- 213 unchanged lines hidden (view full) ---

299 LABEL;
300 (void)printf("%slink_ref expected %s found %s\n",
301 tab, s->slink, cp);
302 }
303 return (label);
304}
305
306const char *
310inotype(type)
311 u_int type;
307inotype(u_int type)
312{
313 switch(type & S_IFMT) {
314 case S_IFBLK:
315 return ("block");
316 case S_IFCHR:
317 return ("char");
318 case S_IFDIR:
319 return ("dir");

--- 7 unchanged lines hidden (view full) ---

327 return ("socket");
328 default:
329 return ("unknown");
330 }
331 /* NOTREACHED */
332}
333
334static const char *
308{
309 switch(type & S_IFMT) {
310 case S_IFBLK:
311 return ("block");
312 case S_IFCHR:
313 return ("char");
314 case S_IFDIR:
315 return ("dir");

--- 7 unchanged lines hidden (view full) ---

323 return ("socket");
324 default:
325 return ("unknown");
326 }
327 /* NOTREACHED */
328}
329
330static const char *
335ftype(type)
336 u_int type;
331ftype(u_int type)
337{
338 switch(type) {
339 case F_BLOCK:
340 return ("block");
341 case F_CHAR:
342 return ("char");
343 case F_DIR:
344 return ("dir");

--- 7 unchanged lines hidden (view full) ---

352 return ("socket");
353 default:
354 return ("unknown");
355 }
356 /* NOTREACHED */
357}
358
359char *
332{
333 switch(type) {
334 case F_BLOCK:
335 return ("block");
336 case F_CHAR:
337 return ("char");
338 case F_DIR:
339 return ("dir");

--- 7 unchanged lines hidden (view full) ---

347 return ("socket");
348 default:
349 return ("unknown");
350 }
351 /* NOTREACHED */
352}
353
354char *
360rlink(name)
361 char *name;
355rlink(char *name)
362{
363 static char lbuf[MAXPATHLEN];
356{
357 static char lbuf[MAXPATHLEN];
364 register int len;
358 int len;
365
366 if ((len = readlink(name, lbuf, sizeof(lbuf) - 1)) == -1)
367 err(1, "line %d: %s", lineno, name);
368 lbuf[len] = '\0';
369 return (lbuf);
370}
359
360 if ((len = readlink(name, lbuf, sizeof(lbuf) - 1)) == -1)
361 err(1, "line %d: %s", lineno, name);
362 lbuf[len] = '\0';
363 return (lbuf);
364}