diff options
author | Tim J. Robbins <tjr@FreeBSD.org> | 2004-07-04 09:52:08 +0000 |
---|---|---|
committer | Tim J. Robbins <tjr@FreeBSD.org> | 2004-07-04 09:52:08 +0000 |
commit | 6fdbbb54872ec7fac83387296f0165f7ad3400a9 (patch) | |
tree | 70ffe417c9436d51a3807610738f2a5993f7f0fc /gnu/usr.bin/grep/system.h | |
parent | 7a39f4da90d53085484e72b7504a3e53dbc9f051 (diff) |
Notes
Diffstat (limited to 'gnu/usr.bin/grep/system.h')
-rw-r--r-- | gnu/usr.bin/grep/system.h | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/gnu/usr.bin/grep/system.h b/gnu/usr.bin/grep/system.h index a6654b694c8f2..99906d8aaf708 100644 --- a/gnu/usr.bin/grep/system.h +++ b/gnu/usr.bin/grep/system.h @@ -53,18 +53,16 @@ extern char *sys_errlist[]; #endif /* Some operating systems treat text and binary files differently. */ -#if O_BINARY +#ifdef __BEOS__ +# undef O_BINARY /* BeOS 5 has O_BINARY and O_TEXT, but they have no effect. */ +#endif +#ifdef HAVE_DOS_FILE_CONTENTS # include <io.h> # ifdef HAVE_SETMODE # define SET_BINARY(fd) setmode (fd, O_BINARY) # else # define SET_BINARY(fd) _setmode (fd, O_BINARY) # endif -#else -# ifndef O_BINARY -# define O_BINARY 0 -# define SET_BINARY(fd) (void)0 -# endif #endif #ifdef HAVE_DOS_FILE_NAMES @@ -80,14 +78,15 @@ extern char *sys_errlist[]; # define FILESYSTEM_PREFIX_LEN(f) 0 #endif -/* This assumes _WIN32, like DJGPP, has D_OK. Does it? In what header? */ -#ifdef D_OK +int isdir PARAMS ((char const *)); + +#ifdef HAVE_DIR_EACCES_BUG # ifdef EISDIR # define is_EISDIR(e, f) \ ((e) == EISDIR \ - || ((e) == EACCES && access (f, D_OK) == 0 && ((e) = EISDIR, 1))) + || ((e) == EACCES && isdir (f) && ((e) = EISDIR, 1))) # else -# define is_EISDIR(e, f) ((e) == EACCES && access (f, D_OK) == 0) +# define is_EISDIR(e, f) ((e) == EACCES && isdir (f)) # endif #endif |