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) |
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 |
|
|