bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

a patch to fix sh_stat on SunOS


From: Dmitry Goncharov
Subject: a patch to fix sh_stat on SunOS
Date: Tue, 9 Aug 2016 21:12:16 -0400
User-agent: Mutt/1.5.21 (2010-09-15)

Good morning,

The following piece of shell code does not work on sunos.
mkfifo /tmp/pipe
cat < /tmp/pipe &
exec 6>/tmp/pipe
test -p /dev/fd/6 && echo pipe

The reason is on sunos /dev/fd/6 is a special character file, not a pipe
(unlike bsd), not a symlink (unlike linux, cygwin).
sh_stat ends up calling stat("/dev/fd/6", finfo) and obtains stat of /dev/fd/6
file rather than stat of the file pointed to by fd 6.

The patch in the attachment makes sh_stat always use fstat regardless of
HAVE_DEV_FD.
I've tested this patch on linux, sunos and aix.

regards, Dmitry

Attachment: devfd2.diff
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]