/[grep]/grep/src/grep.c
ViewVC logotype

Diff of /grep/src/grep.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.83 by kasal, Sat Nov 20 16:15:57 2004 UTC revision 1.84 by kasal, Sat Nov 20 16:20:38 2004 UTC
# Line 255  reset (int fd, char const *file, struct Line 255  reset (int fd, char const *file, struct
255    bufbeg[-1] = eolbyte;    bufbeg[-1] = eolbyte;
256    bufdesc = fd;    bufdesc = fd;
257    
   if (fstat (fd, &stats->stat) != 0)  
     {  
       error (0, errno, "fstat");  
       return 0;  
     }  
   if (directories == SKIP_DIRECTORIES && S_ISDIR (stats->stat.st_mode))  
     return 0;  
 #ifndef DJGPP  
   if (devices == SKIP_DEVICES && (S_ISCHR(stats->stat.st_mode) || S_ISBLK(stats->stat.st_mode) || S_ISSOCK(stats->stat.st_mode)))  
 #else  
   if (devices == SKIP_DEVICES && (S_ISCHR(stats->stat.st_mode) || S_ISBLK(stats->stat.st_mode)))  
 #endif  
     return 0;  
258    if (S_ISREG (stats->stat.st_mode))    if (S_ISREG (stats->stat.st_mode))
259      {      {
260        if (file)        if (file)
# Line 928  grepfile (char const *file, struct stats Line 915  grepfile (char const *file, struct stats
915      }      }
916    else    else
917      {      {
918          if (stat (file, &stats->stat) != 0)
919            {
920              suppressible_error (file, errno);
921              return 1;
922            }
923          if (directories == SKIP_DIRECTORIES && S_ISDIR (stats->stat.st_mode))
924            return 1;
925    #ifndef DJGPP
926          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)))
927    #else
928          if (devices == SKIP_DEVICES && (S_ISCHR(stats->stat.st_mode) || S_ISBLK(stats->stat.st_mode)))
929    #endif
930            return 1;
931        while ((desc = open (file, O_RDONLY)) < 0 && errno == EINTR)        while ((desc = open (file, O_RDONLY)) < 0 && errno == EINTR)
932          continue;          continue;
933    

Legend:
Removed from v.1.83  
changed lines
  Added in v.1.84

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26