#elif defined(HAVE_SECURITY_OPENPAM_H)
# include <security/openpam.h>
#endif
-#include <sys/sendfile.h>
#ifdef HAVE_LIBAUDIT
# include <libaudit.h>
fd = openat(dd, d->d_name, O_RDONLY|O_CLOEXEC);
if (fd >= 0) {
- struct stat st;
- if (fstat(fd, &st) == 0 && st.st_size > 0)
- sendfile(fileno(stdout), fd, NULL, st.st_size);
+ ul_copy_file(fd, fileno(stdout));
close(fd);
done++;
}
if (S_ISREG(st.st_mode) && st.st_size > 0) {
int fd = open(file, O_RDONLY, 0);
if (fd >= 0) {
- sendfile(fileno(stdout), fd, NULL, st.st_size);
+ ul_copy_file(fd, fileno(stdout));
close(fd);
}
done++;