diff options
Diffstat (limited to 'src/diff.c')
-rw-r--r-- | src/diff.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -1172,6 +1172,13 @@ compare_files (struct comparison const *parent, cmp.file[f].desc = STDIN_FILENO; if (binary && ! isatty (STDIN_FILENO)) set_binary_mode (STDIN_FILENO, O_BINARY); +#ifdef __hpux + /* Recognize file descriptors closed by the parent on HP-UX. */ + int flags = fcntl (STDIN_FILENO, F_GETFL, NULL); + if (flags >= 0 && (flags & FD_CLOEXEC) != 0) + cmp.file[f].desc = ERRNO_ENCODE (EBADF); + else +#endif if (fstat (STDIN_FILENO, &cmp.file[f].stat) != 0) cmp.file[f].desc = ERRNO_ENCODE (errno); else |