diff options
author | Chet Ramey <chet.ramey@case.edu> | 2014-02-26 10:31:21 -0500 |
---|---|---|
committer | Chet Ramey <chet.ramey@case.edu> | 2014-02-26 10:31:21 -0500 |
commit | 7628b745a813aac53586b640da056a975f1c443e (patch) | |
tree | f27689da65e9873cd0a77f64f334814989ef5478 /posixdir.h | |
parent | 3fede80c7ae9d396a98137ec8e7188a27c327e96 (diff) | |
download | readline-7628b745a813aac53586b640da056a975f1c443e.tar.gz |
Readline-6.3 distribution sources and documentationreadline-6.3
Diffstat (limited to 'posixdir.h')
-rw-r--r-- | posixdir.h | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -1,6 +1,6 @@ /* posixdir.h -- Posix directory reading includes and defines. */ -/* Copyright (C) 1987,1991 Free Software Foundation, Inc. +/* Copyright (C) 1987,1991,2012 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. @@ -46,16 +46,26 @@ # define D_NAMLEN(d) ((d)->d_namlen) #endif /* !HAVE_DIRENT_H */ +/* The bash code fairly consistenly uses d_fileno; make sure it's available */ #if defined (HAVE_STRUCT_DIRENT_D_INO) && !defined (HAVE_STRUCT_DIRENT_D_FILENO) # define d_fileno d_ino #endif -#if defined (_POSIX_SOURCE) && (!defined (HAVE_STRUCT_DIRENT_D_INO) || defined (BROKEN_DIRENT_D_INO)) /* Posix does not require that the d_ino field be present, and some systems do not provide it. */ +#if !defined (HAVE_STRUCT_DIRENT_D_INO) || defined (BROKEN_DIRENT_D_INO) # define REAL_DIR_ENTRY(dp) 1 #else # define REAL_DIR_ENTRY(dp) (dp->d_ino != 0) #endif /* _POSIX_SOURCE */ +#if defined (HAVE_STRUCT_DIRENT_D_INO) && !defined (BROKEN_DIRENT_D_INO) +# define D_INO_AVAILABLE +#endif + +/* Signal the rest of the code that it can safely use dirent.d_fileno */ +#if defined (D_INO_AVAILABLE) || defined (HAVE_STRUCT_DIRENT_D_FILENO) +# define D_FILENO_AVAILABLE 1 +#endif + #endif /* !_POSIXDIR_H_ */ |