diff options
| author | apb <apb@NetBSD.org> | 2006-01-14 09:18:17 +0000 |
|---|---|---|
| committer | apb <apb@NetBSD.org> | 2006-01-14 09:18:17 +0000 |
| commit | cea5941d7816bf7827c889a99e2abd110dc323ba (patch) | |
| tree | 3bcae756490c0eab3185e86fce647f3315c0abec /gnu/dist/diffutils/src | |
| parent | 77e5f3531a26ba91ee8e4237d40f0e19778d0f4a (diff) | |
Two special files that both refer to the same device should be treated
as identical.
PR 30779
Approved by christos
Diffstat (limited to 'gnu/dist/diffutils/src')
| -rw-r--r-- | gnu/dist/diffutils/src/diff.c | 9 | ||||
| -rw-r--r-- | gnu/dist/diffutils/src/system.h | 4 |
2 files changed, 7 insertions, 6 deletions
diff --git a/gnu/dist/diffutils/src/diff.c b/gnu/dist/diffutils/src/diff.c index e087fa76969..a2d04aa89a4 100644 --- a/gnu/dist/diffutils/src/diff.c +++ b/gnu/dist/diffutils/src/diff.c @@ -1,4 +1,4 @@ -/* $NetBSD: diff.c,v 1.1.1.1 2003/01/26 00:43:16 wiz Exp $ */ +/* $NetBSD: diff.c,v 1.2 2006/01/14 09:18:17 apb Exp $ */ /* diff - compare files line by line @@ -1208,9 +1208,10 @@ compare_files (struct comparison const *parent, else if ((same_files = (cmp.file[0].desc != NONEXISTENT && cmp.file[1].desc != NONEXISTENT - && 0 < same_file (&cmp.file[0].stat, &cmp.file[1].stat) - && same_file_attributes (&cmp.file[0].stat, - &cmp.file[1].stat))) + && (same_special_file (&cmp.file[0].stat, &cmp.file[1].stat) + || (0 < same_file (&cmp.file[0].stat, &cmp.file[1].stat) + && same_file_attributes (&cmp.file[0].stat, + &cmp.file[1].stat))))) && no_diff_means_no_output) { /* The two named files are actually the same physical file. diff --git a/gnu/dist/diffutils/src/system.h b/gnu/dist/diffutils/src/system.h index 0fa5e58b4fd..790f239fba6 100644 --- a/gnu/dist/diffutils/src/system.h +++ b/gnu/dist/diffutils/src/system.h @@ -1,4 +1,4 @@ -/* $NetBSD: system.h,v 1.1.1.1 2003/01/26 00:43:16 wiz Exp $ */ +/* $NetBSD: system.h,v 1.2 2006/01/14 09:18:17 apb Exp $ */ /* System dependent declarations. @@ -349,7 +349,7 @@ verify (lin_is_printable_as_long, sizeof (lin) <= sizeof (long)); /* Do struct stat *S, *T describe the same special file? */ #ifndef same_special_file -# if HAVE_ST_RDEV && defined S_ISBLK && defined S_ISCHR +# if HAVE_STRUCT_STAT_ST_RDEV && defined S_ISBLK && defined S_ISCHR # define same_special_file(s, t) \ (((S_ISBLK ((s)->st_mode) && S_ISBLK ((t)->st_mode)) \ || (S_ISCHR ((s)->st_mode) && S_ISCHR ((t)->st_mode))) \ |
