/[gentoo-alt]/trunk/prefix-overlay/sys-apps/grep/files/grep-2.5.1-fix-devices-skip.patch
Gentoo

Contents of /trunk/prefix-overlay/sys-apps/grep/files/grep-2.5.1-fix-devices-skip.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 908 - (show annotations) (download)
Tue Nov 29 20:23:28 2005 UTC (8 years, 4 months ago) by grobian
File size: 1842 byte(s)
Updated to newest grep version (with a new patch) and added portnotes.


1 http://bugs.gentoo.org/113640
2
3 2004-11-20 Benno Schulenberg <benno@nietvergeten.nl> (tiny change)
4
5 * src/grep.c (reset): Move the stat check ...
6 (grepfile): ... here, and also check for a fifo.
7
8 Index: src/grep.c
9 ===================================================================
10 RCS file: /cvsroot/grep/grep/src/grep.c,v
11 retrieving revision 1.83
12 retrieving revision 1.84
13 diff -u -p -r1.83 -r1.84
14 --- src/grep.c 20 Nov 2004 16:15:57 -0000 1.83
15 +++ src/grep.c 20 Nov 2004 16:20:38 -0000 1.84
16 @@ -255,19 +255,6 @@ reset (int fd, char const *file, struct
17 bufbeg[-1] = eolbyte;
18 bufdesc = fd;
19
20 - if (fstat (fd, &stats->stat) != 0)
21 - {
22 - error (0, errno, "fstat");
23 - return 0;
24 - }
25 - if (directories == SKIP_DIRECTORIES && S_ISDIR (stats->stat.st_mode))
26 - return 0;
27 -#ifndef DJGPP
28 - if (devices == SKIP_DEVICES && (S_ISCHR(stats->stat.st_mode) || S_ISBLK(stats->stat.st_mode) || S_ISSOCK(stats->stat.st_mode)))
29 -#else
30 - if (devices == SKIP_DEVICES && (S_ISCHR(stats->stat.st_mode) || S_ISBLK(stats->stat.st_mode)))
31 -#endif
32 - return 0;
33 if (S_ISREG (stats->stat.st_mode))
34 {
35 if (file)
36 @@ -928,6 +915,19 @@ grepfile (char const *file, struct stats
37 }
38 else
39 {
40 + if (stat (file, &stats->stat) != 0)
41 + {
42 + suppressible_error (file, errno);
43 + return 1;
44 + }
45 + if (directories == SKIP_DIRECTORIES && S_ISDIR (stats->stat.st_mode))
46 + return 1;
47 +#ifndef DJGPP
48 + if (devices == SKIP_DEVICES && (S_ISCHR(stats->stat.st_mode) || S_ISBLK(stats->stat.st_mode) || S_ISSOCK(stats->stat.st_mode) || S_ISFIFO(stats->stat.st_mode)))
49 +#else
50 + if (devices == SKIP_DEVICES && (S_ISCHR(stats->stat.st_mode) || S_ISBLK(stats->stat.st_mode)))
51 +#endif
52 + return 1;
53 while ((desc = open (file, O_RDONLY)) < 0 && errno == EINTR)
54 continue;
55

  ViewVC Help
Powered by ViewVC 1.1.20