tech-userlevel archive

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

Re: /bin/sh redirection in 'while' loop not closed afterwards?



On Wed, Sep 28, 2011 at 09:44:57AM +0200, Anthony Mallet wrote:
> On Wednesday, at 08:26, David Laight wrote:
> |                     if (sv_fd != -1)
> |                                 sv->renamed[fd] = sv_fd;
> |                     else {
> |                                 if (errno != EBADF) {
> |                                     INTON;
> |                                     error("%d: %s", fd, strerror(errno));
> |                                     /* NOTREACHED */
> |                             }
> 
> --->                          sv->renamed[fd] = CLOSED;

Switching the first two lines:
                        sv->renamed[fd] = sv_fd;
                        if (sv_fd == -1) {
                                 if (errno != EBADF) {
Will solve that one.
Which may be why 'EMPTY' is -2, not -1.

        David

-- 
David Laight: david%l8s.co.uk@localhost


Home | Main Index | Thread Index | Old Index