dont double close fd_out in some case - sob - simple output bar
 (HTM) git clone git://git.codemadness.org/sob
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit a48d9425805d5d8029aa8e63cdbf52a50b6baec2
 (DIR) parent 9016f01349bd3d07d8bd208cc3144116d0961d63
 (HTM) Author: Hiltjo Posthuma <hiltjo@codemadness.org>
       Date:   Thu,  2 Oct 2014 01:19:07 +0000
       
       dont double close fd_out in some case
       
       Diffstat:
         M sob.c                               |       7 +++++--
       
       1 file changed, 5 insertions(+), 2 deletions(-)
       ---
 (DIR) diff --git a/sob.c b/sob.c
       @@ -404,13 +404,16 @@ pipereadline(int fd_in, int fd_out, char *writestr, char *outbuf,
                                        if((w = write(fd_out, writestr, strlen(writestr))) == -1)
                                                goto fini;
                                        close(fd_out); /* sends EOF */
       +                                fd_out = -1;
                                        haswritten = 1;
                                }
                        }
                }
        fini:
       -        close(fd_in);
       -        close(fd_out);
       +        if(fd_in != -1)
       +                close(fd_in);
       +        if(fd_out != -1)
       +                close(fd_out);
                return status;
        }