Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 27 Oct 1996 16:19:12 -0700 (MST)
From:      Nate Williams <nate@mt.sri.com>
To:        Archie Cobbs <archie@whistle.com>
Cc:        current@freebsd.org
Subject:   Re: Strange bug related to fstat()
Message-ID:  <199610272319.QAA18645@rocky.mt.sri.com>
In-Reply-To: <199610272250.OAA14535@bubba.whistle.com>
References:  <199610272250.OAA14535@bubba.whistle.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> Within a little background daemon, the system() command is used
> to execute a command looking something like this:
> 
>   system("tar cf - file1 file2 | gzip -cf | uuencode files > output");
> 
> What's happening is that gzip is failing, and the place it fails
> is where it tries to fstat() standard input:
> 
>   if (fstat(fileno(stdin), &istat) != 0) {
>       error("fstat(stdin)");
>   }
> 
> The error it's getting is "Bad file descriptor".

...
> The only other possibilities seem to be a bug in /bin/sh or the
> kernel.  As you can see, I need a little hint as to how to pursue
> this one...

Older versions of ash (pre-4.4Lite) used to get this error all the time,
so I suspect a sh bug.

I don't know for sure, but it's strikingly familiar.


Nate



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199610272319.QAA18645>