bug-texinfo
[Top][All Lists]
Advanced

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

makeinfo should accept /dev/fd/0 argument


From: Bruno Haible
Subject: makeinfo should accept /dev/fd/0 argument
Date: Tue, 26 Aug 2008 01:06:43 +0200
User-agent: KMail/1.5.4

'makeinfo' refuses to read from stdin when it is named /dev/fd/0 (on Linux).

$ makeinfo --version
makeinfo (GNU texinfo) 4.12.94
...
$ { echo '@firstparagraphindent insert'; cat install.texi; } \
  | makeinfo --plaintext --no-warn /dev/fd/0 >INSTALL
$ ls -l INSTALL
-rw-r--r--    1 bruno    user            0 Aug 26 00:59 INSTALL

strace reveals these system calls:

stat64("/dev/fd/0.txi", 0xbfffe4a0)     = -1 ENOENT (No such file or directory)
stat64("/dev/fd/0.texinfo", 0xbfffe4a0) = -1 ENOENT (No such file or directory)
stat64("/dev/fd/0.texi", 0xbfffe4a0)    = -1 ENOENT (No such file or directory)
stat64("/dev/fd/0.txinfo", 0xbfffe4a0)  = -1 ENOENT (No such file or directory)
stat64("/dev/fd/0", {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
open("/dev/fd/0", O_RDONLY|O_LARGEFILE) = 5
read(5, "", 0)                          = 0
close(5)                                = 0
exit_group(0)                           = ?

Probably makeinfo read only 0 bytes because that is the st_size of the file.
But st_size of a file is meaningful only if a file is a regular file or
block device (S_ISREG || S_ISBLK), but here it is an S_ISFIFO file!

Bruno





reply via email to

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