don't fail posix_spawn on failed close
authorRich Felker <dalias@aerifal.cx>
Sat, 6 Dec 2014 02:15:41 +0000 (21:15 -0500)
committerRich Felker <dalias@aerifal.cx>
Sat, 6 Dec 2014 02:15:41 +0000 (21:15 -0500)
the resolution of austin group issue #370 removes the requirement that
posix_spawn fail when the close file action is performed on an
already-closed fd. since there are no other meaningful errors for
close, just ignoring the return value completely is the simplest fix.

src/process/posix_spawn.c

index ae262f7e338b0c3f91741b85aa9712c3c34daed4..af1273170a034aa9781ebb277d6f6c1f27f8f9ea 100644 (file)
@@ -102,8 +102,7 @@ static int child(void *args_vp)
                        }
                        switch(op->cmd) {
                        case FDOP_CLOSE:
-                               if ((ret=__syscall(SYS_close, op->fd)))
-                                       goto fail;
+                               __syscall(SYS_close, op->fd);
                                break;
                        case FDOP_DUP2:
                                if ((ret=__sys_dup2(op->srcfd, op->fd))<0)