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

Re: [Libguestfs] [PATCH x 3] Three small fixes for Debian

On Wed, Nov 04, 2009 at 02:49:13PM +0000, Richard W.M. Jones wrote:
> There is currently another bug in the Debian tests which I'm looking
> into.  hexdump always fails as follows:
> libguestfs: error: hexdump: hexdump: /test123: hexdump: /sysroot/test123: Bad file descriptor

Not nice ...  hexdump does 'freopen (filename, "r", stdin)':


However when we run external commands, they have no stdin -- not even
/dev/null, fd 0 is literally closed:


According to the freopen man page, this shouldn't be a problem.  If
'stdin' is closed then freopen should just open a new stdin.  And of
course the same command does work fine on Fedora builds.

Anyway, I'm still experimenting with this one ...  It might be better
just to open /dev/null for stdin, since I suppose other programs could
be unpredictable if they have no stdin at all.


Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.

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