I'd rather think of this as a bug in the test case, not a bug in 'diff'. This is because the test case assumes more about the shell's "<&-" construct than what POSIX requires. The bigger picture here is that invoking programs with stdin closed is trouble, and although Gnulib provides several modules to work around the trouble these modules are a hassle and many applications don't use them. We should encourage platforms like HP-UX that try to work around the trouble, instead of having diffutils attempt to simulate the traditional but inferior exec semantics. Although the Linux kernel currently implements the traditional semantics, in this particular case I think I'd rather have diffutils adjust to what the platform provides, rather than attempt to simulate Linux behavior even on non-Linux kernels. So I propose the attached further patch.