… | |
… | |
208 | #endif |
208 | #endif |
209 | |
209 | |
210 | #define D_NAME(entp) entp->d_name |
210 | #define D_NAME(entp) entp->d_name |
211 | |
211 | |
212 | /* POSIX_SOURCE is useless on bsd's, and XOPEN_SOURCE is unreliable there, too */ |
212 | /* POSIX_SOURCE is useless on bsd's, and XOPEN_SOURCE is unreliable there, too */ |
213 | #if __FreeBSD__ || defined __NetBSD__ || defined __OpenBSD__ |
213 | #if __FreeBSD__ || __NetBSD__ || __OpenBSD__ |
214 | #define _DIRENT_HAVE_D_TYPE /* sigh */ |
214 | #define _DIRENT_HAVE_D_TYPE /* sigh */ |
215 | #define D_INO(de) (de)->d_fileno |
215 | #define D_INO(de) (de)->d_fileno |
216 | #define D_NAMLEN(de) (de)->d_namlen |
216 | #define D_NAMLEN(de) (de)->d_namlen |
217 | #elif __linux || defined d_ino || _XOPEN_SOURCE >= 600 |
217 | #elif __linux || defined d_ino || _XOPEN_SOURCE >= 600 |
218 | #define D_INO(de) (de)->d_ino |
218 | #define D_INO(de) (de)->d_ino |
… | |
… | |
1149 | |
1149 | |
1150 | /* according to source inspection, this is correct, and useful behaviour */ |
1150 | /* according to source inspection, this is correct, and useful behaviour */ |
1151 | if (sbytes) |
1151 | if (sbytes) |
1152 | res = sbytes; |
1152 | res = sbytes; |
1153 | |
1153 | |
1154 | # elif defined (__APPLE__) |
1154 | # elif defined __APPLE__ |
1155 | off_t sbytes = count; |
1155 | off_t sbytes = count; |
1156 | res = sendfile (ifd, ofd, offset, &sbytes, 0, 0); |
1156 | res = sendfile (ifd, ofd, offset, &sbytes, 0, 0); |
1157 | |
1157 | |
1158 | /* according to the manpage, sbytes is always valid */ |
1158 | /* according to the manpage, sbytes is always valid */ |
1159 | if (sbytes) |
1159 | if (sbytes) |